Browse Source

feat(all): 增加配送明细2.0

1 优化配送明细报表
visual
zhaoqiaobo 6 months ago
parent
commit
40e5a2b327
  1. 14
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/ReportDeliveryController.java
  2. 3
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapeer.java
  3. 73
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapper.xml
  4. 43
      blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryDetailV2Reader.java
  5. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/IAsyncService.java
  6. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/ReportDeliverService.java
  7. 5
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/AsyncServiceImpl.java
  8. 27
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

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

@ -90,6 +90,13 @@ public class ReportDeliveryController extends BladeController {
IPage<ReportDetailVO> pages = reportDeliverService.detailsPage(vo, query);
return R.data(pages);
}
@GetMapping("/details/v2")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "配送明细报表v2", notes = "配送明细报表v2")
public R<IPage<ReportDetailVO>> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query) {
IPage<ReportDetailVO> pages = reportDeliverService.detailsPageV2(vo, query);
return R.data(pages);
}
@GetMapping("/exportDetails")
@ApiOperationSupport(order = 6)
@ -97,6 +104,13 @@ public class ReportDeliveryController extends BladeController {
public void exportDetails(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
reportDeliverService.exportDetails(response, vo, query);
}
@GetMapping("/exportDetails/v2")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "导出配送明细报表v2", notes = "导出配送明细报表v2")
public void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
reportDeliverService.exportDetailsV2(response, vo, query);
}
@GetMapping("/stockOrder")

3
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapeer.java

@ -70,6 +70,9 @@ public interface ReportDeliverMapeer extends BaseMapper {
List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(@Param("idBatch") List<Long> idBatch);
Long getDetailsPageCount(@Param("ew") Wrapper query);
Long getDetailsV2PageCount(@Param("ew") Wrapper query);
List<ReportDetailVO> getDetailsPageExport(@Param("ew") Wrapper queryWrapper, @Param("current") Integer current, @Param("size") Integer size);
List<ReportDetailVO> getDetailsPageV2(IPage<ReportDetailVO> page, @Param("ew") Wrapper queryWrapper);
}

73
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportDeliverMapper.xml

@ -500,6 +500,74 @@
<select id="getDetailsPage" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageSql"/>
</select>
<select id="getDetailsPageV2" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageV2Sql"/>
</select>
<sql id="detailsPageV2Sql">
select *
from (select plan_train_number train_number,
plan_reservation_code reservation_code,
delivery_time task_time,
warehouse_name warehouse_name,
warehouse_id warehouse_id,
delivery_type type,
delivery_kind kind,
vehicle_name vehicle_name,
driver_name driver_name,
distribution_company distribution_company,
custom_name dr_consignee,
custom_phone delivery_phone,
custom_address delivery_address,
consignee_unit consignee,
consignee_person consignee_name,
consignee_mobile consignee_mobile,
waybill_number waybill_no,
order_code stock_article_id,
order_package_code order_package_code,
train_number customer_train,
case
when conditions = 1 then '订制品'
when conditions = 2 then '零担'
when conditions = 3 then '库存品' end conditions,
firsts_product firsts,
second_product decond,
third_product third_product,
materiel_code material_code,
materiel_name material_name,
begin_warehouse_name start_war,
begin_warehouse_in_time start_war_in_time,
begin_warehouse_out_time start_war_out_time,
end_warehouse_in_time warehouse_entry_time_end,
case
when sign_status = 1 then '已签收'
when sign_status = 0 then '未签收'
when sign_status = -1 then '已回库' end driver_signing,
load_time unload_time,
load_user_name un_administrators_name,
sign_time sjsigning_time,
sign_user_name lds_signee_name,
case when review_time is null then '未复核' else '已复核' end signing_status,
review_time signing_time,
sign_num sign_num,
case
when sign_type = 1 then '司机扫描签收'
when sign_type = 2 then '司机批量签收'
when sign_type = 1 then '文员批量签收' end sign_type,
case
when load_type = 2 then '按件装车'
when load_type = 3 then '按订单装车'
when load_type = 4 then '一键装车'
when load_type = 5 then '补录装车' end loading_mode,
brand_name brand,
review_user_name examine_user_name,
case
when plan_reservation_code = sign_reservation_code then '否'
when plan_reservation_code != sign_reservation_code then '是'
else '' end abnormal_signing
from logpm_quality_deliver
order by id desc
) t ${ew.customSqlSegment}
</sql>
<sql id="detailsZeroPage">
select
id,
@ -837,6 +905,11 @@
<include refid="detailsPageSql"></include>
) t
</select>
<select id="getDetailsV2PageCount" resultType="java.lang.Long">
select count(*) from (
<include refid="detailsPageV2Sql"></include>
) t
</select>
<select id="getDetailsPageExport" resultType="com.logpm.report.vo.ReportDetailVO">
<include refid="detailsPageSql"></include>

43
blade-service/logpm-report/src/main/java/com/logpm/report/reader/DeliveryDetailV2Reader.java

@ -0,0 +1,43 @@
package com.logpm.report.reader;
import cn.hutool.core.convert.Convert;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.report.mapper.ReportDeliverMapeer;
import com.logpm.report.service.ExportReader;
import com.logpm.report.service.IAsyncService;
import io.prometheus.client.CollectorRegistry;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zhaoqiaobo
* @create 2024-03-08 9:50
*/
@Component
public class DeliveryDetailV2Reader implements ExportReader {
@Resource
private ReportDeliverMapeer reportDeliverMapeer;
@Autowired
private CollectorRegistry collectorRegistry;
@Autowired
private IAsyncService asyncService;
@Override
public Long getCount(Wrapper query) {
Page page = new Page(1, 1);
Long detailsPageCount = reportDeliverMapeer.getDetailsV2PageCount(query);
return detailsPageCount;
}
@Override
public List<T> findList(Page page, Wrapper query) {
return asyncService.detailsPageV2(page, query, Convert.toInt(page.getCurrent()), Convert.toInt(page.getSize()));
}
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/IAsyncService.java

@ -23,4 +23,6 @@ public interface IAsyncService {
List<ReportDetailVO> getdetailPages(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
List<ReportDetailVO> getdetailPagesExport(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
List<ReportDetailVO> detailsPageV2(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size);
}

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

@ -96,4 +96,9 @@ public interface ReportDeliverService {
List<T> getDeliveryTrainPageReader(Page page, Wrapper query);
List<DeliveryTrainLoadedScanDTO> getDeliveryTrainLoadSacnInvnByIds(List<Long> idBatch);
IPage<ReportDetailVO> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query);
void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query);
}

5
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/AsyncServiceImpl.java

@ -177,5 +177,10 @@ public class AsyncServiceImpl implements IAsyncService {
return detailsPage;
}
@Override
public List<ReportDetailVO> detailsPageV2(IPage<ReportDetailVO> page, Wrapper queryWrapper, Integer current, Integer size) {
return reportDeliverMapeer.getDetailsPageV2(page, queryWrapper);
}
}

27
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportDeliverServiceImpl.java

@ -18,6 +18,7 @@ import com.logpm.report.query.ReportDevilerQuery;
import com.logpm.report.query.StockOrderQuery;
import com.logpm.report.reader.DeliveryCustomerReader;
import com.logpm.report.reader.DeliveryDetailReader;
import com.logpm.report.reader.DeliveryDetailV2Reader;
import com.logpm.report.reader.DeliveryTrainReader;
import com.logpm.report.reader.StockOrderReader;
import com.logpm.report.service.IAsyncService;
@ -64,6 +65,7 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
private final DeliveryTrainReader deliveryTrainReader;
private final DeliveryCustomerReader deliveryCustomerReader;
private final DeliveryDetailReader deliveryDetailReader;
private final DeliveryDetailV2Reader deliveryDetailV2Reader;
private final StockOrderReader stockOrderReader;
private final IBasicdataWarehouseClient warehouseClient;
private final ReportDataService reportDataService;
@ -406,4 +408,29 @@ public class ReportDeliverServiceImpl implements ReportDeliverService {
return reportDeliverMapeer.getDeliveryTrainLoadSacnInvnByIds(idBatch);
}
@Override
public IPage<ReportDetailVO> detailsPageV2(ReportDetailVO vo, DevilerDetailsQuery query) {
// 添加时间校验
checkDetailDate(vo, query);
Integer current = query.getCurrent();
Integer size = query.getSize();
IPage<ReportDetailVO> page = Condition.getPage(query);
QueryWrapper<ReportDetailVO> queryWrapper = QueryUtil.buildQueryWrapper(vo, ReportDetailVO.class);
detailsCustomQuery(query, queryWrapper);
// 仓库权限
ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient);
List<ReportDetailVO> detailsPage = anAsyncService.detailsPageV2(page, queryWrapper, current, size);
return page.setRecords(detailsPage);
}
@Override
public void exportDetailsV2(HttpServletResponse response, ReportDetailVO vo, DevilerDetailsQuery query) {
checkDetailDate(vo, query);
QueryWrapper<ReportDetailVO> queryWrapper = QueryUtil.buildQueryWrapper(vo, ReportDetailVO.class);
detailsCustomQuery(query, queryWrapper);
// 仓库权限
ReportUtil.buildReportWarehouseAuth(vo.getWarehouseName(), query.getWarehouseNameRange(), queryWrapper, warehouseClient);
reportExcelUtil.export(response, deliveryDetailV2Reader, ReportDetailVO.class, queryWrapper, "配送明细报表");
}
}

Loading…
Cancel
Save