汤建军
11 months ago
9 changed files with 125 additions and 12 deletions
@ -0,0 +1,20 @@
|
||||
package com.logpm.report.mapper; |
||||
|
||||
import com.logpm.report.excel.BillLoadingReportExcel; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Mapper |
||||
public interface ReportBillLoadingMapper { |
||||
|
||||
|
||||
/** |
||||
* 导出自提单 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BillLoadingReportExcel> exportBillLoading(@Param("param") Map<String, Object> param); |
||||
} |
@ -0,0 +1,22 @@
|
||||
<?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.ReportBillLoadingMapper"> |
||||
|
||||
|
||||
<select id="exportBillLoading" resultType="com.logpm.report.excel.BillLoadingReportExcel"> |
||||
SELECT |
||||
ldbl.create_time AS createdTime, |
||||
IF(SUM(ldbll.quantity) is null,0,SUM(ldbll.quantity)) AS BillLoadingNum, |
||||
IF( (SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='1' AND is_deleted = 0) is null,0, (SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='1' AND is_deleted = 0)) AS collectPaymentFee, |
||||
IF((SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='2' AND is_deleted = 0) is null,0,(SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='2' AND is_deleted = 0)) AS transportFee, |
||||
IF((SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='3' AND is_deleted = 0) is null ,0,(SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='3' AND is_deleted = 0) )AS storageFee, |
||||
IF((SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='4' AND is_deleted = 0) is null,0,(SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='4' AND is_deleted = 0)) AS forkliftFee, |
||||
IF((SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='5' AND is_deleted = 0) is null,0,(SELECT money FROM logpm_distribution_delivery_charge WHERE bill_lading = ldbl.id AND cost ='5' AND is_deleted = 0)) AS addValueFee |
||||
FROM |
||||
logpm_distrilbution_bill_lading AS ldbl |
||||
LEFT JOIN logpm_distribution_delivery_charge AS lddc ON ldbl.id = lddc.bill_lading |
||||
LEFT JOIN logpm_distribution_bill_lading_scan AS ldbll ON ldbll.bill_lading_id = ldbl.id |
||||
GROUP BY |
||||
ldbl.id |
||||
</select> |
||||
</mapper> |
@ -1,7 +1,18 @@
|
||||
package com.logpm.report.service; |
||||
|
||||
import com.logpm.report.excel.BillLoadingReportExcel; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface IReportBillLoadingAsyncService { |
||||
|
||||
|
||||
/** |
||||
* 导出自提单报表 |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
List<BillLoadingReportExcel> exportBillLoading(Map<String, Object> param); |
||||
|
||||
} |
||||
|
@ -1,19 +1,38 @@
|
||||
package com.logpm.report.service.impl; |
||||
|
||||
import com.logpm.report.excel.BillLoadingReportExcel; |
||||
import com.logpm.report.mapper.ReportBillLoadingMapper; |
||||
import com.logpm.report.service.IReportBillLoadingAsyncService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.log4j.Log4j2; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springframework.scheduling.annotation.Async; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Log4j2 |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class ReportBillLoadingAsyncService implements IReportBillLoadingAsyncService { |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private ReportBillLoadingMapper reportBillLoadingMapper; |
||||
|
||||
/** |
||||
* @param param |
||||
* @return |
||||
*/ |
||||
@Override |
||||
@Async |
||||
public List<BillLoadingReportExcel> exportBillLoading(Map<String, Object> param) { |
||||
List<BillLoadingReportExcel> list = reportBillLoadingMapper.exportBillLoading(param); |
||||
log.info("导出数据条数:{}",list.size()); |
||||
list.stream().forEach(l->l.setAmountToFee(l.getForkliftFee()+l.getAddValueFee()+l.getStorageFee()+l.getCollectPaymentFee()+l.getTransportFee())); |
||||
return list; |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue