This commit is contained in:
linfso 2025-05-05 18:05:10 +08:00
parent f776024f02
commit 0e98328a0b
5 changed files with 135 additions and 0 deletions

View File

@ -106,6 +106,22 @@ public class EmisSettleBillController extends BaseController
return getDataTable(list);
}
/**
* 收款统计
* @param emisSettleBill
* @return
*/
@GetMapping("/queryPayBackStatList")
public TableDataInfo queryPayBackStatList(EmisSettleBill emisSettleBill)
{
startPage();
setPrivParams(emisSettleBill);
List<Map> list = emisSettleBillService.selectBillPayStatInfoList(emisSettleBill);
return getDataTable(list);
}
/**
* 开票统计
* @param emisSettleBill

View File

@ -11,6 +11,8 @@
package com.xdadan.erp.emis.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdadan.erp.common.annotation.audit.DataAuditLog;
import com.xdadan.erp.common.annotation.audit.OperateType;
@ -47,6 +49,14 @@ public interface EmisSettleBillMapper extends BaseMapper<EmisSettleBill>
public List<BillPayStatInfo> selectBillPayStatInfoList(EmisSettleBill emisSettleBill);
/**
* 收款统计
* @param emisSettleBill
* @return
*/
public List<Map> queryPayBackStatList(EmisSettleBill emisSettleBill);
public List<OpenBillStatInfo> selectOpenBillStatInfoList(EmisSettleBill emisSettleBill);
/**

View File

@ -47,6 +47,13 @@ public interface IEmisSettleBillService extends IDataAuditService
*/
public List<BillPayStatInfo> selectBillPayStatInfoList(EmisSettleBill emisSettleBill);
/**
* 收款统计
* @param emisSettleBill
* @return
*/
public List<Map> queryPayBackStatList(EmisSettleBill emisSettleBill);
/**
* 获取开票统计数据
* @param emisSettleBill

View File

@ -121,6 +121,12 @@ public class EmisSettleBillServiceImpl extends EmisBaseService implements IEmisS
return emisSettleBillMapper.selectBillPayStatInfoList(emisSettleBill);
}
@Override
public List<Map> queryPayBackStatList(EmisSettleBill emisSettleBill)
{
return emisSettleBillMapper.queryPayBackStatList(emisSettleBill);
}
/**
* 获取开票统计数据
* @param emisSettleBill

View File

@ -111,6 +111,102 @@
</resultMap>
<!-- 收款统计-PMS需求:379-->
<select id="queryPayBackStatList" parameterType="EmisSettleBill" resultType="map">
SELECT
tba.settle_bill_no AS settleBillNo,
tba.settle_bill_name as settleBillName,
tba.cust_no as custNo,
tba.cust_name as custName,
tba.customer_name as customerName,
tba.bill_month as billMonth,
tba.settle_type as settleType,
tba.open_bill_status as openBillStatus,
tba.payment_status as paymentStatus,
tba.rec_money as recMoney,
tba.reced_money as recedMoney,
tba.salesmen as salesmen,
tba.payee as payee,
IFNULL( tbb.recdMoneyIn, 0 ) AS recdMoneyIn,
IFNULL( tbb.recdPayMoney60D, 0 ) recdPayMoney60D,
(tba.rec_money - tba.reced_money ) AS noRecMoney
FROM
(
SELECT
settle_bill_no,
settle_bill_name,
cust_no,
cust_name,
customer_name,
bill_month,
settle_type,
open_bill_status,
payment_status,
rec_money,
reced_money,
salesmen,
payee
FROM
emis_settle_bill a
<where>
a.del_flag='0'
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</if>
<if test="settleType != null and settleType != ''"> and a.settle_type= #{settleType}</if>
<if test="billMonth != null and billMonth!='' "> and a.bill_month = #{billMonth}</if>
<if test="openBillStatus != null and openBillStatus != ''"> and a.open_bill_status = #{openBillStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or a.salesmen in(
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
)
)
</if>
</where>
) tba
LEFT JOIN (
SELECT
a.settle_bill_no,
sum( if( b.trade_date <![CDATA[ <= ]]> a.payment_due_date,b.pay_money,0) ) AS recdMoneyIn,
sum( if(b.trade_date <![CDATA[ > ]]> a.payment_due_date and b.trade_date <![CDATA[ <= ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY ),b.pay_money,0) ) AS recdPayMoney60D
FROM
emis_settle_bill a,
emis_settle_pay_record b,
emis_settle_pay_bill_rel c
<where>
a.del_flag = '0'
AND b.del_flag = '0'
AND c.del_flag = '0'
AND a.settle_bill_no = c.settle_bill_no
AND b.pay_id = c.pay_id
AND b.trade_date <![CDATA[ > ]]> a.payment_due_date
AND b.trade_date <![CDATA[ <= ]]> DATE_SUB( a.payment_due_date, INTERVAL - 30 DAY )
<if test="salesmen != null and salesmen!='' "> and a.salesmen = #{salesmen}</if>
<if test="settleType != null and settleType != ''"> and a.settle_type= #{settleType}</if>
<if test="billMonth != null and billMonth!='' "> and a.bill_month = #{billMonth}</if>
<if test="openBillStatus != null and openBillStatus != ''"> and a.open_bill_status = #{openBillStatus}</if>
<if test="paymentStatus != null and paymentStatus != ''"> and a.payment_status = #{paymentStatus}</if>
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and (
a.salesmen=#{params.privEmpName}
or a.payee=#{params.privEmpName}
or a.salesmen in(
select salesmen from emis_salesmen_rel esr where esr.del_flag='0' and esr.bl_open='1' and now() <![CDATA[ >= ]]> esr.start_date and now() <![CDATA[ <= ]]> esr.end_date and esr.sales_ass=#{params.privEmpName}
)
)
</if>
</where>
GROUP BY a.settle_bill_no
) tbb ON tba.settle_bill_no = tbb.settle_bill_no
</select>
<select id="selectBillPayStatInfoList" parameterType="EmisSettleBill" resultMap="BillPayStatInfoResult">
select tba.salesmen,
tba.billMonth,