Browse Source

Merge remote-tracking branch 'origin/pre-production'

master
zhenghaoyu 4 months ago
parent
commit
7bded74e6f
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java
  2. 12
      blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  4. 52
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportTimeController.java
  5. 27
      blade-service/logpm-report/src/main/java/com/logpm/report/dto/ReportTimeDTO.java
  6. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml
  7. 23
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.java
  8. 219
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml
  9. 18
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IReportTimeService.java
  10. 90
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportTimeServiceImpl.java
  11. 7
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java
  12. 37
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportCheckWaybillTimeVO.java
  13. 45
      blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeVO.java
  14. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  15. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  16. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java
  17. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java
  18. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  19. 48
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  20. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java
  21. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

1
blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java

@ -45,6 +45,7 @@ public enum WorkNodeEnums implements Serializable {
SIGN_DIRECT_SHIPPER(105030,"直发商家签收"),
END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"),
NO_STOCK_CAR(105050, "本车次少货"),
COST_SHARE(105060, "车次成本分摊"),
SORTING_TRAYS(201010, "分拣打托"),
UN_SORTING_TRAYS(201020, "包件解托"),

12
blade-biz-common/src/main/java/org/springblade/common/constant/broadcast/FanoutConstants.java

@ -39,6 +39,18 @@ public abstract class FanoutConstants {
}
}
interface COSTSHARE {
// 交换机
String EXCHANGE = "fanout.trunkline.costshare" + ModuleNameConstant.DEVAUTH;
interface QUEUE {
// 保存基础数据
String REPORT_COSTSHARE = "fanout.trunkline.reportdata.report.costshare" + ModuleNameConstant.DEVAUTH;
}
}

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

@ -632,7 +632,7 @@
logpm_distribution_reservation_stocklist AS ldrs
INNER JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id AND ldsl.is_deleted = 0
INNER JOIN logpm_dis_stock_list_detail AS ldsld ON ldrs.reservation_id = ldsld.reservation_id AND ldsld.is_deleted = 0 AND ldsld.stock_package_status != 2
ldrs.stocklist_id = ldsl.id
AND ldrs.stocklist_id = ldsl.id
WHERE
ldrs.is_deleted = 0
AND ldrs.reservation_id = #{reservationId}

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

@ -0,0 +1,52 @@
package com.logpm.report.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.report.dto.ReportTimeDTO;
import com.logpm.report.service.IReportTimeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@RestController
@AllArgsConstructor
@RequestMapping("/reportTime")
@Api(value = "时效报表", tags = "时效报表")
public class ReportTimeController extends BladeController {
private final IReportTimeService reportTimeService;
@PostMapping("/openTimePage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开单时效报表", notes = "开单时效报表")
public R openTimePage(@RequestBody ReportTimeDTO reportTimeDTO) {
return reportTimeService.openTimePage(reportTimeDTO);
}
@PostMapping("/openTimeExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "开单时效报表导出", notes = "开单时效报表导出")
public void openTimeExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
reportTimeService.openTimeExport(reportTimeDTO,response);
}
@PostMapping("/checkWaybillTimePage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "审单时效报表", notes = "审单时效报表")
public R checkWaybillTimePage(@RequestBody ReportTimeDTO reportTimeDTO) {
return reportTimeService.checkWaybillTimePage(reportTimeDTO);
}
@PostMapping("/checkWaybillTimeExport")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "审单时效报表导出", notes = "审单时效报表导出")
public void checkWaybillTimeExport(@RequestBody ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
reportTimeService.checkWaybillTimeExport(reportTimeDTO,response);
}
}

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

@ -0,0 +1,27 @@
package com.logpm.report.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
public class ReportTimeDTO implements Serializable {
private Integer pageNum;
private Integer pageSize;
private List<String> businessLineList;
private List<String> brandList;
private List<Long> warehouseIds;
private List<Long> departureWarehouseIds;
private List<Long> destinationWarehouseIds;
private String startTimeStr;
private String endTimeStr;
private Date startTime;
private Date endTime;
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportIncomingMapper.xml

@ -243,7 +243,7 @@
MONTH(lww.document_making_time)
</select>
<select id="ReportConsigneeIncomingExportVO" resultType="com.logpm.report.vo.ReportConsigneeIncomingExportVO">
<select id="consigneeIncomingExport" resultType="com.logpm.report.vo.ReportConsigneeIncomingExportVO">
select waw.business_line businessLine,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_name destinationWarehouseName,

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

@ -0,0 +1,23 @@
package com.logpm.report.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.report.dto.ReportTimeDTO;
import com.logpm.report.vo.ReportCheckWaybillTimeVO;
import com.logpm.report.vo.ReportOpenTimeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ReportTimeMapper {
IPage<ReportOpenTimeVO> openTimePage(IPage<Object> page,@Param("param") ReportTimeDTO reportTimeDTO);
List<ReportOpenTimeVO> openTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
IPage<ReportCheckWaybillTimeVO> checkWaybillTimePage(IPage<Object> page, @Param("param") ReportTimeDTO reportTimeDTO);
List<ReportCheckWaybillTimeVO> checkWaybillTimeExport(@Param("param") ReportTimeDTO reportTimeDTO);
}

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

@ -0,0 +1,219 @@
<?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.ReportTimeMapper">
<select id="openTimePage" resultType="com.logpm.report.vo.ReportOpenTimeVO">
select waw.business_line businessLine,
lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName,
lta.brand brand,
count(lta.id) totalNum,
sum(if(lta.waybill_status='1',1,0)) hasOpenNum,
sum(if(lta.waybill_status = '0',1,0)) noOpenNum,
IFNULL(round(sum(if(lta.waybill_status = '0',1,0))/count(lta.id)*100,2),'0.00') noOpenRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0)) noOpenHasFreezeNum,
IFNULL(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0))/count(lta.id)*100,2),'0.00') noOpenHasFreezeRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0)) noOpenNoFreezeNum,
IFNULL(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0))/count(lta.id)*100,2),'0.00') noOpenNoFreezeRate,
sum(IF( lta.waybill_status='1' and lww.create_time &lt;= DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 )) onTimeNum,
sum(IF( lta.waybill_status='1' and lww.create_time &gt; DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 )) overTimeNum,
IFNULL(round(sum(IF( lta.waybill_status='1' and lww.create_time &lt;= DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 ))/sum(if(lta.waybill_status='1',1,0))*100,2),'0.00') onTimeRate,
IFNULL(round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time))/sum(if(lta.waybill_status='1',1,0))/3600,1),'0.0') avgTime
from logpm_trunkline_advance lta
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no
where lta.create_time &gt; '2024-10-22 00:00:00'
and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lta.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and lta.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lta.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lta.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lta.warehouse_id,
lta.warehouse_name,
lta.brand
</select>
<select id="openTimeExport" resultType="com.logpm.report.vo.ReportOpenTimeVO">
select waw.business_line businessLine,
lta.warehouse_id warehouseId,
lta.warehouse_name warehouseName,
lta.brand brand,
count(lta.id) totalNum,
sum(if(lta.waybill_status='1',1,0)) hasOpenNum,
sum(if(lta.waybill_status = '0',1,0)) noOpenNum,
IFNULL(concat(round(sum(if(lta.waybill_status = '0',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0)) noOpenHasFreezeNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '1',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenHasFreezeRate,
sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0)) noOpenNoFreezeNum,
IFNULL(concat(round(sum(if(lta.waybill_status='0' and lta.freeze_status = '0',1,0))/count(lta.id)*100,2),'%'),'0.00%') noOpenNoFreezeRate,
sum(IF( lta.waybill_status='1' and lww.create_time &lt;= DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 )) onTimeNum,
sum(IF( lta.waybill_status='1' and lww.create_time &gt; DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 )) overTimeNum,
IFNULL(concat(round(sum(IF( lta.waybill_status='1' and lww.create_time &lt;= DATE_ADD( lta.create_time, INTERVAL 72 HOUR ), 1, 0 ))/sum(if(lta.waybill_status='1',1,0))*100,2),'%'),'0.00%') onTimeRate,
IFNULL(round(sum(TIMESTAMPDIFF(SECOND, lta.create_time, lww.create_time))/sum(if(lta.waybill_status='1',1,0))/3600,1),'0.0') avgTime
from logpm_trunkline_advance lta
left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id
left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no
where lta.create_time &gt; '2024-10-22 00:00:00'
and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.brandList != null and param.brandList.size() > 0">
and lta.brand in
<foreach collection="param.brandList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.warehouseIds != null and param.warehouseIds.size() > 0">
and lta.warehouse_id in
<foreach collection="param.warehouseIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="param.startTime != null ">
and lta.create_time &gt;= #{param.startTime}
</if>
<if test="param.endTime != null ">
and lta.create_time &lt;= #{param.endTime}
</if>
group by waw.business_line,
lta.warehouse_id,
lta.warehouse_name,
lta.brand
</select>
<select id="checkWaybillTimePage" resultType="com.logpm.report.vo.ReportCheckWaybillTimeVO">
select waw.business_line businessLine,
lww.departure_warehouse_id departureWarehouseId,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_id destinationWarehouseId,
lww.destination_warehouse_name destinationWarehouseName,
lww.brand brand,
count(lww.id) totalNum,
sum(if(lww.check_status=1,1,0)) hasCheckNum,
IFNULL(round(sum(if(lww.check_status=1,1,0))/count(lww.id)*100,2),'0.00') hasCheckRate,
sum(IF( lww.check_status=1 and lww.check_time &lt;= DATE_ADD( lww.create_time, INTERVAL 72 HOUR ), 1, 0 )) onTimeCheckNum,
IFNULL(round(sum(IF( lww.check_status=1 and lww.check_time &lt;= DATE_ADD( lww.create_time, INTERVAL 72 HOUR ), 1, 0 ))/sum(if(lww.check_status=1,1,0))*100,2),'0.00') onTimeCheckRate,
IFNULL(round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time))/sum(if(lww.check_status=1,1,0))/3600,1),'0.0') avgCheckTime
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
where lww.create_time > '2024-10-22 00:00:00'
and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</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.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_id,
lww.departure_warehouse_name,
lww.destination_warehouse_id,
lww.destination_warehouse_name,
lww.brand
</select>
<select id="checkWaybillTimeExport" resultType="com.logpm.report.vo.ReportCheckWaybillTimeVO">
select waw.business_line businessLine,
lww.departure_warehouse_id departureWarehouseId,
lww.departure_warehouse_name departureWarehouseName,
lww.destination_warehouse_id destinationWarehouseId,
lww.destination_warehouse_name destinationWarehouseName,
lww.brand brand,
count(lww.id) totalNum,
sum(if(lww.check_status=1,1,0)) hasCheckNum,
IFNULL(concat(round(sum(if(lww.check_status=1,1,0))/count(lww.id)*100,2),'%'),'0.00%') hasCheckRate,
sum(IF( lww.check_status=1 and lww.check_time &lt;= DATE_ADD( lww.create_time, INTERVAL 72 HOUR ), 1, 0 )) onTimeCheckNum,
IFNULL(concat(round(sum(IF( lww.check_status=1 and lww.check_time &lt;= DATE_ADD( lww.create_time, INTERVAL 72 HOUR ), 1, 0 ))/sum(if(lww.check_status=1,1,0))*100,2),'%'),'0.00%') onTimeCheckRate,
IFNULL(round(sum(TIMESTAMPDIFF(SECOND, lww.create_time, lww.check_time))/sum(if(lww.check_status=1,1,0))/3600,1),'0.0') avgCheckTime
from logpm_warehouse_waybill lww
left join logpm_warehouse_warehouse waw on waw.id = lww.departure_warehouse_id
where lww.create_time > '2024-10-22 00:00:00'
and waw.business_line is not null
<if test="param.businessLineList != null and param.businessLineList.size() > 0">
and waw.business_line in
<foreach collection="param.businessLineList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</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.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_id,
lww.departure_warehouse_name,
lww.destination_warehouse_id,
lww.destination_warehouse_name,
lww.brand
</select>
</mapper>

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

@ -0,0 +1,18 @@
package com.logpm.report.service;
import com.logpm.report.dto.ReportTimeDTO;
import org.springblade.core.tool.api.R;
import javax.servlet.http.HttpServletResponse;
public interface IReportTimeService {
R openTimePage(ReportTimeDTO reportTimeDTO);
void openTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response);
R checkWaybillTimePage(ReportTimeDTO reportTimeDTO);
void checkWaybillTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response);
}

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

@ -0,0 +1,90 @@
package com.logpm.report.service.impl;
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.mapper.ReportTimeMapper;
import com.logpm.report.service.IReportTimeService;
import com.logpm.report.vo.ReportCheckWaybillTimeVO;
import com.logpm.report.vo.ReportOpenTimeVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Service
@Slf4j
@AllArgsConstructor
public class ReportTimeServiceImpl implements IReportTimeService {
private final ReportTimeMapper reportTimeMapper;
@Override
public R openTimePage(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()));
IPage<ReportOpenTimeVO> iPage = reportTimeMapper.openTimePage(page,reportTimeDTO);
return R.data(iPage);
}
@Override
public void openTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
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()));
List<ReportOpenTimeVO> list = reportTimeMapper.openTimeExport(reportTimeDTO);
//导出ls
ExcelUtil.export(response, "开单及时率报表导出", "开单及时率报表导出", list, ReportOpenTimeVO.class);
}
@Override
public R checkWaybillTimePage(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()));
IPage<ReportCheckWaybillTimeVO> iPage = reportTimeMapper.checkWaybillTimePage(page,reportTimeDTO);
return R.data(iPage);
}
@Override
public void checkWaybillTimeExport(ReportTimeDTO reportTimeDTO, HttpServletResponse response) {
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()));
List<ReportCheckWaybillTimeVO> list = reportTimeMapper.checkWaybillTimeExport(reportTimeDTO);
//导出ls
ExcelUtil.export(response, "审单及时率报表导出", "审单及时率报表导出", list, ReportCheckWaybillTimeVO.class);
}
}

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

@ -498,13 +498,10 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
indexTrunklineHandOrderDataVO.setHandleNum(packageHandleNum + zeroHandleNum);
indexTrunklineHandOrderDataVO.setHandleWeight(packageHandleWeight.add(zeroHandleWeight));
indexTrunklineHandOrderDataVO.setHandleVolume(packageHandleVolume.add(zeroHandleVolume));
indexTrunklineHandOrderDataVO.setWarehouseName(getCacheWarehouseName(indexTrunklineHandOrderDataVO.getWarehouseId()));
data.add(indexTrunklineHandOrderDataVO);
bladeRedis.setEx(key, indexTrunklineHandOrderDataVO, 3600L);
}
data.add(indexTrunklineHandOrderDataVO);
});
return data;
}
@ -935,7 +932,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService {
carsStattisNumVO.setWarehouseId(warehouseId);
carsStattisNumVO.setWarehouseName(getCacheWarehouseName(warehouseId));
bladeRedis.setEx(key, carsStattisNumVO, 3600L);
}
data.add(carsStattisNumVO);
}

37
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportCheckWaybillTimeVO.java

@ -0,0 +1,37 @@
package com.logpm.report.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReportCheckWaybillTimeVO implements Serializable {
@ExcelProperty(value = "事业线")
private String businessLine;
@ExcelIgnore
private Long departureWarehouseId;
@ExcelProperty(value = "发站仓")
private String departureWarehouseName;
@ExcelIgnore
private Long destinationWarehouseId;
@ExcelProperty(value = "目的仓")
private String destinationWarehouseName;
@ExcelProperty(value = "品牌")
private String brand;
@ExcelProperty(value = "总运单数")
private Integer totalNum;
@ExcelProperty(value = "已审单数")
private Integer hasCheckNum;
@ExcelProperty(value = "审单率")
private String hasCheckRate;
@ExcelProperty(value = "准时审单数")
private Integer onTimeCheckNum;
@ExcelProperty(value = "审单准时率")
private String onTimeCheckRate;
@ExcelProperty(value = "平均审单时效")
private String avgCheckTime;
}

45
blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeVO.java

@ -0,0 +1,45 @@
package com.logpm.report.vo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class ReportOpenTimeVO implements Serializable {
@ExcelProperty(value = "事业线")
private String businessLine;
@ExcelIgnore
private Long warehouseId;
@ExcelProperty(value = "导入仓库")
private String warehouseName;
@ExcelProperty(value = "品牌")
private String brand;
@ExcelProperty(value = "总单数")
private Integer totalNum;
@ExcelProperty(value = "已开单数")
private Integer hasOpenNum;
@ExcelProperty(value = "未开单数")
private Integer noOpenNum;
@ExcelProperty(value = "未开单占比")
private String noOpenRate;
@ExcelProperty(value = "未开单已冻结数")
private Integer noOpenHasFreezeNum;
@ExcelProperty(value = "未开单已冻结占比")
private String noOpenHasFreezeRate;
@ExcelProperty(value = "未开单未处理数")
private Integer noOpenNoFreezeNum;
@ExcelProperty(value = "未处理占比")
private String noOpenNoFreezeRate;
@ExcelProperty(value = "准时开单数")
private Integer onTimeNum;
@ExcelProperty(value = "超期开单数")
private Integer overTimeNum;
@ExcelProperty(value = "开单准时率")
private String onTimeRate;
@ExcelProperty(value = "平均开单时效")
private String avgTime;
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -2446,12 +2446,13 @@ public class CarsLoadController {
return R.fail(405,"多仓权限无法操作,请选择仓库");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
loadCarsDTO.setWarehouseName(myCurrentWarehouse.getName());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);
return R.fail(405,"配载id为空");
}
return carsLoadService.costShareByLoadId(loadId);
return carsLoadService.costShareByLoadId(loadId,loadCarsDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -470,6 +470,7 @@
left join logpm_distribution_parcel_list ldpl on ltco.order_code = ldpl.order_code and ldpl.waybill_number = ltco.waybill_no
where ltco.load_id = #{param.loadId}
and ltco.final_node_id = #{param.finalNodeId}
and ldpl.warehouse_id = #{param.warehouseId}
and ldpl.is_deleted = 0
group by ltco.id,
ltco.order_code,

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/waybil/StatusLogListener.java

@ -5,9 +5,6 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.feign.ITrunklineWaybillTrackClient;
import com.logpm.trunkline.mapper.TrunklineWaybillPackageMapper;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -23,7 +20,6 @@ import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@ -110,7 +106,6 @@ public class StatusLogListener {
value = @Queue(name = FanoutConstants.distribution.DeliveryAndrecheck.QUEUE.waybillStatusLog, durable = "true"),
exchange = @Exchange(name = FanoutConstants.distribution.DeliveryAndrecheck.EXCHANGE, type = ExchangeTypes.FANOUT)
))
@Transactional(rollbackFor = Exception.class)
public void statusDekiveryLog(String msg) {
log.info("商/市配送 复核处理运单日志和状态: {}", msg);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ICarsLoadAsyncService.java

@ -11,7 +11,7 @@ public interface ICarsLoadAsyncService {
void saveCostShareRecord(Long loadId, TrunklineCarsLoadEntity carsLoadEntity, Long userId, String tenantId, String deptId);
void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity);
void costShareByLoadId(Long loadId,TrunklineCarsLoadEntity carsLoadEntity,Long warehouseId,String warehouseName);
void abnormalListStartCarByLoadIdAndWarehouseId(Long loadId, Long warehouseId,Long userId,Long deptId,String nickName,String tenantId,String warehouseName);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -188,7 +188,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R findCostShareBefore(Long loadId);
R costShareByLoadId(Long loadId);
R costShareByLoadId(Long loadId,LoadCarsDTO loadCarsDTO);
R abnormalList(LoadCarsDTO loadCarsDTO);

48
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -303,7 +303,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
@LogpmAsync("asyncExecutor")
@Override
public void costShareByLoadId(Long loadId, TrunklineCarsLoadEntity carsLoadEntity) {
public void costShareByLoadId(Long loadId, TrunklineCarsLoadEntity carsLoadEntity,Long warehouseId,String warehouseName) {
String proportion1 = DictBizCache.getValue(DictBizConstant.TRUNKLINE_COST_PROPORTION, "1");
String proportion2 = DictBizCache.getValue(DictBizConstant.TRUNKLINE_COST_PROPORTION, "2");
@ -385,6 +385,52 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
}
sendReportCostShareData(list,AuthUtil.getUserId(),AuthUtil.getNickName(),warehouseId,warehouseName,carsLoadEntity);
}
private void sendReportCostShareData(List<TrunklineCostShareRecordEntity> list, Long userId, String nickName, Long warehouseId, String warehouseName, TrunklineCarsLoadEntity carsLoadEntity) {
NodeFanoutMsg nodeFanoutMsg = new NodeFanoutMsg();
nodeFanoutMsg.setNode(WorkNodeEnums.COST_SHARE);
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD);
nodeFanoutMsg.setOperator(nickName);
nodeFanoutMsg.setOperatorId(userId);
nodeFanoutMsg.setWarehouse(warehouseName);
nodeFanoutMsg.setWarehouseId(warehouseId);
nodeFanoutMsg.setOperatorTime(new Date());
//组装包件数据
JSONObject json = JSONObject.parseObject(JSONObject.toJSONString(carsLoadEntity));
// List<PackageData> packageDataList = new ArrayList<>();
// list.forEach(costShareRecordEntity -> {
// PackageData packageData = new PackageData();
// Integer productType = costShareRecordEntity.getProductType();
// if(productType == 1){
//
// }else if(productType == 2){
//
// }
//
//
// packageData.setPackageCode(packageCode);
// packageData.setNumber(1);
// packageData.setPackageType(PackageTypeEnums.CMP);
// packageDataList.add(packageData);
// });
json.put("details", list);
nodeFanoutMsg.setMain(json);
FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.trunkline.COSTSHARE.EXCHANGE).msg(JSONObject.toJSONString(nodeFanoutMsg)).build();
sendFanoutService.sendFanoutMsg(fanoutMsg);
}
@LogpmAsync("asyncExecutor")

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingWaybillServiceImpl.java

@ -78,16 +78,16 @@ public class TrunklineBillladingWaybillServiceImpl extends BaseServiceImpl<Trunk
BigDecimal price = BigDecimal.ZERO;
if("1".equals(chargeType)){
if(realNum > 0){
price = totalFee.divide(new BigDecimal(realNum),2, RoundingMode.UP);
price = totalFee.divide(new BigDecimal(realNum),8, RoundingMode.HALF_UP);
}
}else if ("2".equals(chargeType)){
if(realWeight.compareTo(BigDecimal.ZERO) > 0){
price = totalFee.divide(realWeight,4, RoundingMode.UP);
price = totalFee.divide(realWeight,8, RoundingMode.HALF_UP);
}
}else if("3".equals(chargeType)){
if(realVolume.compareTo(BigDecimal.ZERO) > 0){
price = totalFee.divide(realVolume,4, RoundingMode.UP);
price = totalFee.divide(realVolume,8,RoundingMode.HALF_UP);
}
}

29
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -2316,6 +2316,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
public R findLinePhoto(LoadCarsDTO loadCarsDTO) {
Long loadId = loadCarsDTO.getLoadId();
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if(Objects.isNull(carsLoadEntity)){
log.warn("#############findLinePhoto: 配载信息不存在 loadId={}",loadId);
return R.fail(405,"配载信息不存在");
}
List<TrunklineCarsLoadLinePhotoEntity> linePhotoEntityList = carsLoadLinePhotoService.findListByLoadIdAndWarehouseId(loadId, null, null, null);
Map<Long, List<TrunklineCarsLoadLinePhotoEntity>> linePhotoMap = linePhotoEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadLinePhotoEntity::getLoadLineId));
@ -2333,6 +2339,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Map<String,Object> map = new HashMap<>();
map.put("carsLoadLineEntity",loadLineEntity);
map.put("nowWarehouseId",carsLoadEntity.getNowWarehouseId());
List<TrunklineCarsLoadLinePhotoEntity> trunklineCarsLoadLinePhotoEntities = linePhotoMap.get(loadLineId);
@ -5520,10 +5527,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
trunklineCostShareRecordEntity.setLoadingWarehouseId(warehouseId);
trunklineCostShareRecordEntity.setLoadingWarehouseName(warehouseName);
trunklineCostShareRecordEntity.setPlanUnloadWarehouseId(finalNodeId);
if(!Objects.isNull(finalNodeId)){
BasicdataWarehouseEntity finalWarehouse = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
if (!Objects.isNull(finalWarehouse)) {
trunklineCostShareRecordEntity.setPlanUnloadWarehouseName(finalWarehouse.getName());
}
}
trunklineCostShareRecordEntity.setRealUnloadWarehouseId(unloadNodeId);
trunklineCostShareRecordEntity.setRealUnloadWarehouseName(unloadNodeName);
trunklineCostShareRecordEntity.setWaybillStartWarehouseId(departureWarehouseId);
@ -9208,12 +9217,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Integer i = loadingZeroFlag.get();
if(i == 1){
return R.data(ls,"装车完成,但存在零担未装车,请去确认装车数量");
}else{
// if(i == 1){
// return R.data(ls,"装车完成,但存在零担未装车,请去确认装车数量");
// }else{
// return R.data(ls,"装车完成");
// }
return R.data(ls,"装车完成");
}
}
@Override
public R findLoadZeroList(LoadCarsDTO loadCarsDTO) {
@ -9707,7 +9717,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}
@Override
public R costShareByLoadId(Long loadId) {
public R costShareByLoadId(Long loadId,LoadCarsDTO loadCarsDTO) {
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
@ -9720,6 +9730,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划已做过成本分摊");
}
String carsNo = carsLoadEntity.getCarsNo();
List<AftersalesAbnormalRecordEntity> abnormalList = abnormalRecordClient.findAbnormalList(carsNo);
if(CollUtil.isNotEmpty(abnormalList)){
log.warn("#################costShareByLoadId: 该车次还有异常列表未处理 loadId={}", loadId);
return R.fail(405, "该车次还有异常列表未处理");
}
List<TrunklineCarsLoadScanEntity> noDataList = trunklineCarsLoadScanService.findListNoDataByLoadId(loadId);
int size = noDataList.size();
if (size != 0) {
@ -9738,7 +9755,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "配载计划最终节点还未卸车确认");
}
carsLoadAsyncService.costShareByLoadId(loadId, carsLoadEntity);
carsLoadAsyncService.costShareByLoadId(loadId, carsLoadEntity,loadCarsDTO.getWarehouseId(),loadCarsDTO.getWarehouseName());
carsLoadEntity.setCostAllocationType("1");
carsLoadEntity.setCostAllocationAdminId(AuthUtil.getUserId());

Loading…
Cancel
Save