Merge pull request 'develop' (#304) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/304
This commit is contained in:
heyu 2026-01-23 17:32:30 +08:00
commit 72bc7d8e1c
2 changed files with 24 additions and 3 deletions

View File

@ -212,6 +212,10 @@ public class EmisInvoiceCancellationController extends EmisBaseController
return AjaxResult.error("发票不存在");
}
EmisSettleInvoiceRecord invoice = invoiceList.get(0);
if (!"2".equals(invoice.getInvoiceStatus())) {
return AjaxResult.error("未开票");
}
if (emisInvoiceCancellationService.existsActiveApply(invoice.getId())) {
return AjaxResult.error("不可重复添加");
}

View File

@ -65,7 +65,7 @@
i.invoice_no as inv_invoice_no, i.invoice_status as inv_invoice_status, i.payment_status as inv_payment_status,
GROUP_CONCAT(DISTINCT b.bill_month ORDER BY b.bill_month SEPARATOR ',') as bill_month,
GROUP_CONCAT(DISTINCT b.cust_no ORDER BY b.cust_no SEPARATOR ',') as cust_no,
GROUP_CONCAT(DISTINCT b.customer_name ORDER BY b.customer_name SEPARATOR ',') as customer_name
GROUP_CONCAT(DISTINCT b.cust_name ORDER BY b.cust_name SEPARATOR ',') as customer_name
from emis_invoice_cancellation c
left join emis_settle_invoice_record i on c.invoice_id = i.id and i.del_flag = '0'
left join emis_settle_invoice_bill_rel rel on i.apply_seq_no = rel.apply_seq_no and rel.del_flag = '0'
@ -139,8 +139,25 @@
and rel.apply_seq_no = i.apply_seq_no
and b.cust_no = #{params.custNo})
</if>
<if test="params.privSiteCode != null and params.privSiteCode != ''">
and c.apply_site_code = #{params.privSiteCode}
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
and EXISTS(
select 1 from emis_settle_bill x2,emis_settle_invoice_bill_rel x3
where x2.del_flag = '0' and x3.del_flag = '0'
and i.apply_seq_no=x3.apply_seq_no and x2.settle_bill_no=x3.settle_bill_no
AND (
x2.salesmen = #{params.privEmpName}
OR x2.payee = #{params.privEmpName}
OR x2.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 c.id, c.invoice_id, c.apply_seq_no, c.apply_date, c.apply_reason, c.apply_text_url,