This commit is contained in:
linfso 2024-07-18 10:13:14 +08:00
parent 62f5aaec5f
commit dc80d75c81
7 changed files with 222 additions and 35 deletions

View File

@ -22,7 +22,6 @@ public class ScanStatDataInfo implements Serializable {
private Integer scanCount;
private Integer signCount;
private BigDecimal signRate;
// private String billCodeStr;
private String scanSiteCode;
private String scanSiteName;

View File

@ -0,0 +1,37 @@
package com.xdadan.erp.emis.domain.stat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xdadan.erp.emis.domain.EmisWaybill;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 扫描统计信息明细
*/
@Data
public class ScanStatInfoDtl implements Serializable {
private static final long serialVersionUID = 1L;
// 运单号
private String billCode;
// 收件扫描数
private Integer gotCount;
// 发件扫描
private Integer sendCount;
// 到件扫描
private Integer arrivalCount;
// 派件扫描
private Integer sentCount;
// 问题件扫描
private Integer issueCount;
// 留仓次数
private Integer holdCount;
// 运单详情
private EmisWaybill waybillDetail;
}

View File

@ -1,28 +0,0 @@
package com.xdadan.erp.emis.domain.stat;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 寄件录单统计
*/
@Data
public class SendStatDataInfo implements Serializable {
private static final long serialVersionUID = 1L;
/* 录单日期 yyyy-mm-dd */
private String sendDay;
// 扫描记录数,已签收数量
private Integer scanCount;
private Integer signCount;
private String billCodeStr;
private String scanSiteCode;
private String scanSiteName;
}

View File

@ -55,6 +55,22 @@ public interface EmisSettleSubBillMapper extends BaseMapper<EmisSettleSubBill>
public Map getQueryStatInfoMap(EmisSettleSubBill emisSettleSubBill);
/**
* 寄件网点运单统计
* @param emisSettleSubBill
* @return
*/
public Map getSiteSendStatInfoMap(EmisSettleSubBill emisSettleSubBill);
/**
* 目的网点运单统计
* @param emisSettleSubBill
* @return
*/
public Map getSiteDestStatInfoMap(EmisSettleSubBill emisSettleSubBill);
/**
* 根据客户统计月结账单
*/

View File

@ -17,7 +17,9 @@ import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.emis.domain.EmisTmsScanPicInfo;
import com.xdadan.erp.emis.domain.EmisTmsScanRecord;
import com.xdadan.erp.emis.domain.EmisWaybill;
import com.xdadan.erp.emis.domain.stat.ScanStatDataInfo;
import com.xdadan.erp.emis.domain.stat.ScanStatInfoDtl;
import org.apache.ibatis.annotations.Param;
/**
@ -100,4 +102,8 @@ public interface EmisTmsScanRecordMapper extends BaseMapper<EmisTmsScanRecord>
public List<EmisTmsScanRecord> queryScanStatRecordList(EmisTmsScanRecord emisTmsScanRecord);
// 查询统计明细
public List<ScanStatInfoDtl> queryScanStatInfoDtlList(EmisWaybill emisWaybill);
}

View File

@ -78,6 +78,70 @@
</resultMap>
<resultMap type="ScanStatInfoDtl" id="ScanStatInfoDtlResult">
<result property="billCode" column="billCode" />
<result property="gotCount" column="gotCount" />
<result property="sendCount" column="sendCount" />
<result property="arrivalCount" column="arrivalCount" />
<result property="sentCount" column="sentCount" />
<result property="issueCount" column="issueCount" />
<result property="holdCount" column="holdCount" />
<association property="waybillDetail"
column="billCode"
select="com.xdadan.erp.emis.mapper.EmisWaybillMapper.selectWaybillBaseInfoByBillCode"
fetchType="lazy"
/>
</resultMap>
<select id="queryScanStatInfoDtlList" parameterType="EmisWaybill" resultMap="ScanStatInfoDtlResult">
select main_bill_code as bill_code,
sum(IF(scan_type='10',1,0)) as gotCount,
sum(IF(scan_type='20',1,0)) as sendCount,
sum(IF(scan_type='30',1,0)) as arrivalCount,
sum(IF(scan_type='40',1,0)) as sentCount,
sum(IF(scan_type='50',1,0)) as signCount,
sum(IF(scan_type='-1',1,0)) as issueCount,
sum(IF(scan_type='70',1,0)) as holdCount
from emis_tms_scan_record a
where EXISTS(
select 1 from emis_waybill b
where
b.del_flag='0' and waybill_status !='0'
a.main_bill_code=b.bill_code
<if test="params.sendDay != null and params.sendDay != ''">
and DATE(b.send_date)=#{params.sendDay}
</if>
<if test="sendSiteCode != null and sendSiteCode != ''">
and b.send_site_code= #{sendSiteCode}
</if>
<if test="params.beginSendDate != null">
and b.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<if test="params.endSendDate != null ">
and b.send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.dispatch_underling_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
)
and a.scan_type in('10','20','30','40','50','-1')
group by a.main_bill_code
</select>
<!--获取扫描统计数据-->
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">

View File

@ -1053,15 +1053,108 @@
a.create_time desc
</select>
<select id="getQueryStatInfoMap" parameterType="EmisWaybill" resultType="map">
<!-- 寄件网点寄件统计-->
<select id="getSiteSendStatInfoMap" parameterType="EmisWaybill" resultType="map">
select
date_format(a.send_date,'%Y-%m-%d') as sendDate,
a.send_site_code as sendSiteCode,
a.send_center_code as sendCenterCode,
b.site_name as sendSiteName,
c.site_name as sendCenterName,
count(1) as totalNum,
sum(a.parcel_qty) as totalParcelQty,
round(sum(bill_weight),2) as totalBillWeight,
round(sum(total_volume),5) as totalVolume,
round(sum(volume_weight),2) as totalVolumeWeight,
round(sum(settlement_weight),2) as totalSettlementWeight,
round(sum(freight),2) as totalFreight
round(sum(a.bill_weight),2) as totalBillWeight,
round(sum(a.total_volume),5) as totalVolume,
round(sum(a.volume_weight),2) as totalVolumeWeight,
round(sum(a.settlement_weight),2) as totalSettlementWeight,
round(sum(a.freight),2) as totalFreight
from emis_waybill a
left join emis_site b on a.send_site_code = b.site_code and b.del_flag='0'
left join emis_site c on a.send_center_code = c.site_code and c.del_flag='0'
<where>
a.del_flag='0' and order_status !='0'
<if test="sendSiteCode != null and sendSiteCode != ''"> and a.send_site_code= #{sendSiteCode}</if>
<if test="params.beginSendDate != null and params.beginSendDate != ''">
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<if test="params.endSendDate != null and params.endSendDate != ''">
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.send_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
</where>
group by a.send_site_code
order by a.send_date desc
</select>
<!-- 目的网点运单统计-->
<select id="getSiteDestStatInfoMap" parameterType="EmisWaybill" resultType="map">
select
date_format(send_date,'%Y-%m-%d') as sendDate,
dispatch_underling_site_code as dispatchUnderlingSiteCode,
destination_center_code as destinationCenterCode,
b.site_name as dispatchUnderlingSiteName,
c.site_name as destinationCenterName,
count(1) as totalNum,
sum(a.parcel_qty) as totalParcelQty,
round(sum(bill_weight),2) as totalBillWeight,
round(sum(total_volume),5) as totalVolume,
round(sum(volume_weight),2) as totalVolumeWeight,
round(sum(settlement_weight),2) as totalSettlementWeight,
round(sum(freight),2) as totalFreight
from emis_waybill a
left join emis_site b on a.dispatch_underling_site_code = b.site_code and b.del_flag='0'
left join emis_site c on a.destination_center_code = c.site_code and c.del_flag='0'
<where>
a.del_flag='0' and order_status !='0'
<if test="sendSiteCode != null and sendSiteCode != ''"> and a.send_site_code= #{sendSiteCode}</if>
<if test="params.beginSendDate != null and params.beginSendDate != ''">
and a.send_date <![CDATA[ >= ]]> #{params.beginSendDate}
</if>
<if test="params.endSendDate != null and params.endSendDate != ''">
and a.send_date <![CDATA[ <= ]]> #{params.endSendDate}
</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.dispatch_underling_site_code in (
SELECT t1.site_code FROM (
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
#{params.privSiteCode} ) pd
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
UNION
SELECT #{params.privSiteCode} FROM dual
)
)
</if>
</where>
group by a.dispatch_underling_site_code
order by a.send_date desc
</select>
<select id="getQueryStatInfoMap" parameterType="EmisWaybill" resultType="map">
select
count(1) as totalNum,
sum(a.parcel_qty) as totalParcelQty,
round(sum(bill_weight),2) as totalBillWeight,
round(sum(total_volume),5) as totalVolume,
round(sum(volume_weight),2) as totalVolumeWeight,
round(sum(settlement_weight),2) as totalSettlementWeight,
round(sum(freight),2) as totalFreight
from emis_waybill a
<where>
a.del_flag='0' and order_status !='0'