This commit is contained in:
linfso 2024-07-11 09:56:46 +08:00
parent 6283032d3c
commit ca788ede30
5 changed files with 186 additions and 1 deletions

View File

@ -111,7 +111,34 @@ public class EmisSettleSubBillController extends EmisBaseController
}
/**
/**
* 根据月结客户统计月结账单
*/
@PreAuthorize("@ss.hasPermi('emis:emisSettleSubBill:list')")
@GetMapping("/getMonthBillStatInfoMapList")
public TableDataInfo getMonthBillStatInfoMapList(EmisSettleSubBill emisSettleSubBill)
{
startPage();
setPrivParams(emisSettleSubBill);
if(!StringUtils.isEmpty(emisSettleSubBill.getBillCode())){
emisSettleSubBill.setBillCode(WaybillHelper.formatQueryValue(emisSettleSubBill.getBillCode()));
String[] billCodeSortList = emisSettleSubBill.getBillCode().split(",");
if(billCodeSortList.length>1){
emisSettleSubBill.getParams().put("billCodeSortList", Arrays.asList(billCodeSortList));
}
}
List<Map> list = emisSettleSubBillService.getMonthBillStatInfoMapList(emisSettleSubBill);
return getDataTable(list);
}
/**
* 检查是否重复
*
* @param emisSettleSubBill

View File

@ -55,6 +55,11 @@ public interface EmisSettleSubBillMapper extends BaseMapper<EmisSettleSubBill>
public Map getQueryStatInfoMap(EmisSettleSubBill emisSettleSubBill);
/**
* 根据客户统计月结账单
*/
public List<Map> getMonthBillStatInfoMapList(EmisSettleSubBill emisSettleSubBill);
/**
* 检查是否重复
*

View File

@ -47,6 +47,13 @@ public interface IEmisSettleSubBillService
public Map getQueryStatInfoMap(EmisSettleSubBill emisSettleSubBill);
/**
* 根据月结客户统计月结账单
* @param emisSettleSubBill
* @return
*/
public List<Map> getMonthBillStatInfoMapList(EmisSettleSubBill emisSettleSubBill);
/**
* 检查是否重复

View File

@ -71,6 +71,18 @@ public class EmisSettleSubBillServiceImpl implements IEmisSettleSubBillService
return statInfoMap;
}
/**
* 根据月结客户统计月结账单
*
* @param emisSettleSubBill
* @return 获取查询统计信息Map
*/
@Override
public List<Map> getMonthBillStatInfoMapList(EmisSettleSubBill emisSettleSubBill)
{
return emisSettleSubBillMapper.getMonthBillStatInfoMapList(emisSettleSubBill);
}
/**
* 检查是否重复
*

View File

@ -312,6 +312,140 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="getMonthBillStatInfoMapList" parameterType="EmisSettleSubBill" resultType="map">
select
count(a.bill_code) as totalNum,
round(sum(b.bill_fee),2) as totalBillFee,
b.cust_no as custNo,
max(b.customer_name) as customerName,
sum(b.parcel_qty) as parcelQty,
sum(b.bill_weight) as totalBillWeight,
sum(b.total_volume) as totalVolume,
sum(b.volume_weight) as totalVolumeWeight,
sum(b.settlement_weight) as totalSettlementWeight,
sum(b.freight) as totalFreight
from emis_settle_sub_bill b ,emis_waybill a
<where>
a.bill_code=b.bill_code and a.del_flag='0' and b.del_flag='0'
and b.settle_type='2'
<if test="id != null "> and b.id = #{id}</if>
<if test="billNo != null and billNo != ''"> and FIND_IN_SET(b.`bill_no`,#{billNo}) </if>
<if test="parentBillNo != null and parentBillNo != ''"> and b.parent_bill_no=#{parentBillNo}</if>
<if test="settleBillNo != null and settleBillNo != ''"> and b.settle_bill_no=#{settleBillNo}</if>
<if test="billCode != null and billCode != ''"> and ( FIND_IN_SET(b.`bill_code`,#{billCode}) or b.bill_code like concat('%', #{billCode}, '%') ) </if>
<if test="billDate != null "> and bill_date = #{billDate}</if>
<if test="billFee != null "> and bill_fee = #{billFee}</if>
<if test="currency != null and currency != ''"> and currency= #{currency}</if>
<if test="settleType != null and settleType != ''"> and settle_type=#{settleType}</if>
<if test="blSplit != null and blSplit != ''"> and bl_split=#{blSplit}</if>
<if test="billMonth != null and billMonth != ''"> and bill_month=#{billMonth}</if>
<if test="custNo != null and custNo != ''"> and b.cust_no=#{custNo}</if>
<if test="customerCode != null and customerCode != ''"> and b.customer_code=#{customerCode}</if>
<if test="customerName != null and customerName != ''"> and b.customer_name like concat('%', #{customerName}, '%')</if>
<if test="blConfirmCenter != null and blConfirmCenter != ''"> and b.bl_confirm_center = #{blConfirmCenter}</if>
<if test="confirmCenterDate != null "> and b.confirm_center_date = #{confirmCenterDate}</if>
<if test="confirmCenterNote != null and confirmCenterNote != ''"> and b.confirm_center_note = #{confirmCenterNote}</if>
<if test="confirmCenterManCode != null and confirmCenterManCode != ''"> and b.confirm_center_man_code = #{confirmCenterManCode}</if>
<if test="confirmCenterCode != null and confirmCenterCode != ''"> and b.confirm_center_code = #{confirmCenterCode}</if>
<if test="blConfirmSite != null and blConfirmSite != ''"> and b.bl_confirm_site = #{blConfirmSite}</if>
<if test="confirmSiteDate != null "> and b.confirm_site_date = #{confirmSiteDate}</if>
<if test="confirmSiteManCode != null and confirmSiteManCode != ''"> and b.confirm_site_man_code = #{confirmSiteManCode}</if>
<if test="confirmSiteNote != null and confirmSiteNote != ''"> and b.confirm_site_note = #{confirmSiteNote}</if>
<if test="confirmSiteCode != null and confirmSiteCode != ''"> and b.confirm_site_code = #{confirmSiteCode}</if>
<if test="params.sendSiteCode != null and params.sendSiteCode != ''">
and a.send_site_code = #{params.sendSiteCode}
</if>
<if test="params.dispatchUnderlingSiteCode != null and params.dispatchUnderlingSiteCode != ''">
and a.dispatch_underling_site_code = #{params.dispatchUnderlingSiteCode}
</if>
<if test="params.mergeStatus != null and params.mergeStatus == 1">
and b.bl_merge='0'
and b.bl_confirm_center='1'
and b.bl_confirm_site='1'
</if>
<if test="params.mergeStatus != null and params.mergeStatus == 2">
and b.bl_merge='1'
and b.bl_confirm_center='1'
and b.bl_confirm_site='1'
</if>
<if test="params.payee != null and params.payee != ''">
and a.payee = #{params.payee}
</if>
<if test="params.salesmen != null and params.salesmen != ''">
and a.salesmen = #{params.salesmen}
</if>
<if test="params.paymentType != null and params.paymentType != ''">
and a.payment_type = #{params.paymentType}
</if>
<if test="params.blSpecialQuote != null and params.blSpecialQuote != ''">
and a.bl_special_quote = #{params.blSpecialQuote}
</if>
<if test="params.calcFeeType != null and params.calcFeeType != ''">
and a.calc_fee_type = #{params.calcFeeType}
</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
)
or
a.dispatch_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
)
or
a.sign_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
)
or a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
)
</if>
</where>
group by b.cust_no
</select>
<select id="checkUnique" parameterType="EmisSettleSubBill" resultType="int">
select count(1) from emis_settle_sub_bill
where del_flag='0'