修改bug#41972
This commit is contained in:
+20
-10
@@ -4,8 +4,9 @@
|
||||
|
||||
<select id="queryProject" resultType="com.jero.project.entity.PayCommonProject">
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,'' as phone,'' as email,c.remarks,c.contract_num,c.charge_company_temporary_id,c.charge_way,c.files,c.charge_notice_no,c.charge_notice_id,c.year,c.mail_contacts_temporary_name
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,'' as phone,'' as email,c.remarks,c.contract_num,c.charge_company_temporary_id,c.charge_way,c.files,c.charge_notice_no,c.charge_notice_id,c.year,c.mail_contacts_temporary_name
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
AND c.id = #{projectId}
|
||||
@@ -13,8 +14,9 @@
|
||||
</where>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'','',gsub.remarks,gsub.contract_num,gsub.charge_company_temporary_id,gsub.charge_way,'',gsub.charge_notice_no,gsub.charge_notice_id,g.year,gsub.mail_contacts_temporary_name
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'','',gsub.remarks,gsub.contract_num,gsub.charge_company_temporary_id,gsub.charge_way,'',gsub.charge_notice_no,gsub.charge_notice_id,g.year,gsub.mail_contacts_temporary_name
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -23,8 +25,9 @@
|
||||
</where>
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, meeting.director_name,sit.company_contact_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'','',sit.remark,'',sit.company_id,sit.pay_mode,'','','','',''
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_contact_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'','',sit.remark,'',sit.company_id,sit.pay_mode,'','','','',''
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -33,8 +36,9 @@
|
||||
</where>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,pmp.director_name,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'','',msub.remark,msub.contract_no,msub.company_temporary_id,msub.payment_method,'',msub.charge_notice_no,msub.charge_notice_file_id,pmp.particular_year,msub.post_contact_name
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,su.realname,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'','',msub.remark,msub.contract_no,msub.company_temporary_id,msub.payment_method,'',msub.charge_notice_no,msub.charge_notice_file_id,pmp.particular_year,msub.post_contact_name
|
||||
from pay_member_project pmp
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on pmp.id = msub.project_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -43,8 +47,9 @@
|
||||
</where>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,tmember.director_name,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,'','',tmsub.company_id,tmsub.payment_method,'','','',tmember.year,''
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,'','',tmsub.company_id,tmsub.payment_method,'','','',tmember.year,''
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -54,8 +59,9 @@
|
||||
</select>
|
||||
<select id="queryProjectList" resultType="com.jero.project.entity.PayCommonProject">
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,'' as phone,'' as email,c.remarks,c.contract_num,c.charge_company_temporary_id,c.charge_way,c.files
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,'' as phone,'' as email,c.remarks,c.contract_num,c.charge_company_temporary_id,c.charge_way,c.files
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND c.id in
|
||||
@@ -66,8 +72,9 @@
|
||||
</where>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'','',gsub.remarks,gsub.contract_num,gsub.charge_company_temporary_id,gsub.charge_way,''
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'','',gsub.remarks,gsub.contract_num,gsub.charge_company_temporary_id,gsub.charge_way,''
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
@@ -79,8 +86,9 @@
|
||||
</where>
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, meeting.director_name,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'','',sit.remark,'',sit.company_temporary_id,sit.pay_mode,''
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'','',sit.remark,'',sit.company_temporary_id,sit.pay_mode,''
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
@@ -92,8 +100,9 @@
|
||||
</where>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,pmp.director_name,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'','',msub.remark,msub.contract_no,msub.company_temporary_id,msub.payment_method,''
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,su.realname,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'','',msub.remark,msub.contract_no,msub.company_temporary_id,msub.payment_method,''
|
||||
from pay_member_project pmp
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on pmp.id = msub.project_id
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
@@ -105,8 +114,9 @@
|
||||
</where>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,tmember.director_name,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,'','',tmsub.company_id,tmsub.payment_method,''
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.liaison_man_id,tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email,'','',tmsub.company_id,tmsub.payment_method,''
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
<where>
|
||||
<if test="list != null and list.size() > 0">
|
||||
|
||||
+10
-5
@@ -114,11 +114,12 @@
|
||||
pcp.charge_company_temporary_name AS chargeCompanyName,
|
||||
pcp.receivable_amount AS receivableAmount,
|
||||
pcp.paid_amount AS paidAmount,
|
||||
pcp.principal_name AS principalName,
|
||||
su.realname AS principalName,
|
||||
pcp.contacts_temporary_name AS contactsName,
|
||||
pica.create_time AS createTime
|
||||
FROM pay_income_contract_associated pica
|
||||
JOIN pay_common_project pcp ON pica.project_id = pcp.id
|
||||
left join sys_user su on pcp.principal_id = su.id
|
||||
WHERE pica.contract_id = #{contractId}
|
||||
UNION ALL
|
||||
SELECT
|
||||
@@ -131,12 +132,13 @@
|
||||
pwgs.charge_company_temporary_name AS chargeCompanyName,
|
||||
pwgs.receivable_amount AS receivableAmount,
|
||||
pwgs.paid_amount AS paidAmount,
|
||||
pwg.principal_name_a AS principalName,
|
||||
su.realname AS principalName,
|
||||
pwgs.contacts_temporary_name_one AS contactsName,
|
||||
pica.create_time AS createTime
|
||||
FROM pay_income_contract_associated pica
|
||||
JOIN pay_working_group_subitem pwgs ON pica.project_id = pwgs.id
|
||||
LEFT JOIN pay_working_group pwg ON pwgs.working_group_id = pwg.id
|
||||
left join sys_user su on pwg.principal_id_a = su.id
|
||||
WHERE pica.contract_id = #{contractId}
|
||||
UNION ALL
|
||||
SELECT
|
||||
@@ -149,12 +151,13 @@
|
||||
sit.company_name AS chargeCompanyName,
|
||||
sit.amount_receivable AS receivableAmount,
|
||||
sit.paid_amount AS paidAmount,
|
||||
meeting.director_name AS principalName,
|
||||
su.realname AS principalName,
|
||||
sit.company_contact_name AS contactsName,
|
||||
pica.create_time AS createTime
|
||||
FROM pay_income_contract_associated pica
|
||||
JOIN pay_meeting_situation sit ON pica.project_id = sit.id
|
||||
LEFT JOIN pay_meeting meeting ON meeting.id = sit.meeting_id
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
WHERE pica.contract_id = #{contractId}
|
||||
UNION ALL
|
||||
SELECT
|
||||
@@ -167,12 +170,13 @@
|
||||
msub.company_name AS chargeCompanyName,
|
||||
msub.amount_receivable AS receivableAmount,
|
||||
msub.paid_amount AS paidAmount,
|
||||
pmp.director_name AS principalName,
|
||||
su.realname AS principalName,
|
||||
msub.company_contact_name AS contactsName,
|
||||
pica.create_time AS createTime
|
||||
FROM pay_income_contract_associated pica
|
||||
JOIN pay_member_project_subitem msub ON pica.project_id = msub.id
|
||||
LEFT JOIN pay_member_project pmp ON pmp.id=msub.project_id
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
WHERE pica.contract_id = #{contractId}
|
||||
UNION ALL
|
||||
SELECT
|
||||
@@ -185,12 +189,13 @@
|
||||
tmsub.company_name AS chargeCompanyName,
|
||||
tmsub.amount_receivable AS receivableAmount,
|
||||
tmsub.paid_amount AS paidAmount,
|
||||
tmember.director_name AS principalName,
|
||||
su.realname AS principalName,
|
||||
tmsub.liaison_man AS contactsName,
|
||||
pica.create_time AS createTime
|
||||
FROM pay_income_contract_associated pica
|
||||
JOIN tb_member_project_subitem tmsub ON pica.project_id = tmsub.id
|
||||
LEFT JOIN tb_member_project tmember ON tmember.id=tmsub.project_id
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
WHERE pica.contract_id = #{contractId}
|
||||
) a
|
||||
ORDER BY createTime DESC,projectId DESC
|
||||
|
||||
+15
-1
@@ -18,8 +18,22 @@
|
||||
</resultMap>
|
||||
|
||||
<select id="queryListByCompany" resultType="com.jero.member.entity.PayMemberProject">
|
||||
SELECT pmp.*,#{projectType} AS projectType FROM pay_member_project_subitem pmps
|
||||
SELECT pmp.id,
|
||||
pmp.create_by,
|
||||
pmp.create_time,
|
||||
pmp.update_by,
|
||||
pmp.update_time,
|
||||
pmp.project_name,
|
||||
pmp.particular_year,
|
||||
pmp.director_id,
|
||||
su.realname as director_name,
|
||||
pmp.charge_standard,
|
||||
pmp.charge_notice_no,
|
||||
pmp.charge_notice_file_id,
|
||||
pmp.remark,
|
||||
#{projectType} AS projectType FROM pay_member_project_subitem pmps
|
||||
LEFT JOIN pay_member_project pmp ON pmp.id = pmps.project_id
|
||||
left join sys_user su on su.id = pmp.director_id
|
||||
LEFT JOIN pay_pack_company_project ppcp ON ppcp.project_id = pmps.id
|
||||
LEFT JOIN pay_pack_company ppc ON ppc.id = ppcp.pack_id
|
||||
LEFT JOIN pay_income_contract_associated pica ON pica.project_id = pmps.id
|
||||
|
||||
+31
-16
@@ -30,9 +30,10 @@
|
||||
from
|
||||
(
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project,c.invoice_amount, c.charge_use, c.principal_id,c.principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,
|
||||
select c.id,c.charge_project,c.invoice_amount, c.charge_use, c.principal_id,su.realname as principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,
|
||||
if(c.paid_amount is null or c.paid_amount = '','0.00',c.paid_amount) as paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,'' as phone,'' as email
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND c.charge_company_id = #{companyId}
|
||||
@@ -46,9 +47,10 @@
|
||||
</where>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project,gsub.invoice_amount, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,
|
||||
select gsub.id,g.working_group_project,gsub.invoice_amount, gsub.charge_use, g.principal_id_a,su.realname,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,
|
||||
if(gsub.paid_amount is null or gsub.paid_amount = '','0.00',gsub.paid_amount) as paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'',''
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -63,9 +65,10 @@
|
||||
</where>
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.invoice_amount,sit.charge_use, meeting.director_id, meeting.director_name,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,
|
||||
select sit.id,meeting.meeting_name,sit.invoice_amount,sit.charge_use, meeting.director_id, su.realname,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,
|
||||
if(sit.paid_amount is null or sit.paid_amount = '','0.00',sit.paid_amount) as paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,sit.phone,''
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
<where>
|
||||
sit.register_check_result != 0
|
||||
@@ -81,9 +84,10 @@
|
||||
</where>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,pmp.project_name,msub.invoice_amount,msub.charge_use,pmp.director_id,pmp.director_name,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,
|
||||
select msub.id,pmp.project_name,msub.invoice_amount,msub.charge_use,pmp.director_id, su.realname,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,
|
||||
if(msub.paid_amount is null or msub.paid_amount = '','0.00',msub.paid_amount) as paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'',''
|
||||
from pay_member_project pmp
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on pmp.id = msub.project_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -98,9 +102,10 @@
|
||||
</where>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.invoice_amount,tmsub.charge_use,tmember.director_id,tmember.director_name,'',tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,
|
||||
if(tmsub.paid_amount is null or tmsub.paid_amount = '','0.00',tmsub.paid_amount) as paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,mobile,email
|
||||
select tmsub.id,tmember.project_name,tmsub.invoice_amount,tmsub.charge_use,tmember.director_id, su.realname,'',tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,
|
||||
if(tmsub.paid_amount is null or tmsub.paid_amount = '','0.00',tmsub.paid_amount) as paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -130,8 +135,9 @@
|
||||
<select id="queryPackListAll" resultType="com.jero.project.entity.PayCommonProject">
|
||||
SELECT * FROM (
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,c.contacts_temporary_name
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,c.contacts_temporary_name
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
AND c.id = #{projectId}
|
||||
@@ -151,8 +157,9 @@
|
||||
</where>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.contacts_temporary_name_one
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.contacts_temporary_name_one
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -173,8 +180,9 @@
|
||||
</where>
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, meeting.director_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,sit.company_contact_name
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,sit.company_contact_name
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
<where>
|
||||
sit.check_result = 1
|
||||
@@ -196,8 +204,9 @@
|
||||
</where>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id,pmp.director_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,msub.company_contact_name
|
||||
select msub.id,pmp.project_name,msub.charge_use,pmp.director_id, su.realname,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,msub.company_contact_name
|
||||
from pay_member_project pmp
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on pmp.id=msub.project_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -218,8 +227,9 @@
|
||||
</where>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,tmember.director_name,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.liaison_man
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id, su.realname,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.liaison_man
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
<where>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
@@ -278,9 +288,10 @@
|
||||
(
|
||||
<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use,
|
||||
c.principal_id,c.principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1
|
||||
c.principal_id,su.realname as principal_name,c.contacts_temporary_id,c.contacts_temporary_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1
|
||||
as projectType,'' as phone,'' as email
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
AND c.charge_company_id = #{companyId}
|
||||
@@ -295,8 +306,9 @@
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use,
|
||||
g.principal_id_a,g.principal_name_a,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'',''
|
||||
g.principal_id_a,su.realname,gsub.contacts_temporary_id_one,gsub.contacts_temporary_name_one,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,'',''
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -312,8 +324,9 @@
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id,
|
||||
meeting.director_name,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'',''
|
||||
su.realname,sit.company_contact_temporary_id,sit.company_contact_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3,'',''
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -329,8 +342,9 @@
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select
|
||||
msub.id,pmp.project_name,msub.charge_use,pmp.director_id,pmp.director_name,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'',''
|
||||
msub.id,pmp.project_name,msub.charge_use,pmp.director_id,su.realname,msub.company_contact_temporary_id,msub.company_contact_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4,'',''
|
||||
from pay_member_project pmp
|
||||
left join sys_user su on pmp.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on pmp.id = msub.project_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
@@ -346,8 +360,9 @@
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select
|
||||
tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,tmember.director_name,'',tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,mobile,email
|
||||
tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,'',tmsub.liaison_man,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5,tmsub.mobile,tmsub.email
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on tmember.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''">
|
||||
|
||||
+14
-7
@@ -7,8 +7,9 @@
|
||||
select p.id,p.charge_project, p.charge_use, p.principal_id,p.principal_name,p.charge_company_id,p.charge_company_temporary_name,p.receivable_amount,p.paid_amount,p.need_invoice,p.pack,p.in_account,p.make_invoice,p.mail,p.create_time,p.projectType,p.invoice_amount,p.mail_contacts_id,p.register_check_result,p.contacts_temporary_name
|
||||
from
|
||||
(<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.charge_company_id,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,c.invoice_amount,c.mail_contacts_id,'' as register_check_result,c.contacts_temporary_name
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.charge_company_id,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType,c.invoice_amount,c.mail_contacts_id,'' as register_check_result,c.contacts_temporary_name
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
where
|
||||
c.receivable_amount <![CDATA[<>]]> 0
|
||||
and c.receivable_amount is not null
|
||||
@@ -23,8 +24,9 @@
|
||||
</if>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.charge_company_id,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.invoice_amount,gsub.mail_contacts_id,'' as register_check_result,gsub.contacts_temporary_name_one
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_id,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2,gsub.invoice_amount,gsub.mail_contacts_id,'' as register_check_result,gsub.contacts_temporary_name_one
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
where
|
||||
gsub.receivable_amount <![CDATA[<>]]> 0
|
||||
@@ -110,8 +112,9 @@
|
||||
select p.id,p.charge_project, p.charge_use, p.principal_id,p.principal_name,p.charge_company_temporary_name,p.receivable_amount,p.paid_amount,p.need_invoice,p.pack,p.in_account,p.make_invoice,p.mail,p.create_time,p.projectType
|
||||
from
|
||||
(<!-- 普通项目-->
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,c.principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType
|
||||
select c.id,c.charge_project, c.charge_use, c.principal_id,su.realname as principal_name,c.charge_company_temporary_name,c.receivable_amount,c.paid_amount,c.need_invoice,c.pack,c.in_account,c.make_invoice,c.mail,c.create_time,1 as projectType
|
||||
from pay_common_project c
|
||||
left join sys_user su on c.principal_id = su.id
|
||||
where
|
||||
c.receivable_amount <![CDATA[<>]]> 0
|
||||
and c.receivable_amount is not null
|
||||
@@ -126,8 +129,9 @@
|
||||
</if>
|
||||
<!--工作组项目-->
|
||||
UNION ALL
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,g.principal_name_a,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2
|
||||
select gsub.id,g.working_group_project, gsub.charge_use, g.principal_id_a,su.realname,gsub.charge_company_temporary_name,gsub.receivable_amount,gsub.paid_amount,gsub.need_invoice,gsub.pack,gsub.in_account,gsub.make_invoice,gsub.mail,gsub.create_time,2
|
||||
from pay_working_group g
|
||||
left join sys_user su on g.principal_id_a = su.id
|
||||
inner join pay_working_group_subitem gsub on g.id = gsub.working_group_id
|
||||
where
|
||||
gsub.receivable_amount <![CDATA[<>]]> 0
|
||||
@@ -143,8 +147,9 @@
|
||||
</if>
|
||||
<!-- 会议项目-->
|
||||
UNION ALL
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, meeting.director_name,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3
|
||||
select sit.id,meeting.meeting_name,sit.charge_use, meeting.director_id, su.realname,sit.company_name,sit.amount_receivable,sit.paid_amount,sit.need_invoice,sit.pack,sit.in_account,sit.make_invoice,sit.mail,sit.create_time,3
|
||||
from pay_meeting meeting
|
||||
left join sys_user su on meeting.director_id = su.id
|
||||
inner join pay_meeting_situation sit on meeting.id = sit.meeting_id
|
||||
where
|
||||
sit.amount_receivable <![CDATA[<>]]> 0
|
||||
@@ -160,8 +165,9 @@
|
||||
</if>
|
||||
<!-- 会员项目-->
|
||||
UNION ALL
|
||||
select msub.id,member.project_name,msub.charge_use,member.director_id,member.director_name,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4
|
||||
select msub.id,member.project_name,msub.charge_use,member.director_id,su.realname,msub.company_name,msub.amount_receivable,msub.paid_amount,msub.need_invoice,msub.pack,msub.in_account,msub.make_invoice,msub.mail,msub.create_time,4
|
||||
from pay_member_project member
|
||||
left join sys_user su on member.director_id = su.id
|
||||
inner join pay_member_project_subitem msub on member.id=msub.project_id
|
||||
where
|
||||
msub.amount_receivable <![CDATA[<>]]> 0
|
||||
@@ -177,8 +183,9 @@
|
||||
</if>
|
||||
<!-- 标协会员项目-->
|
||||
UNION ALL
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,tmember.director_name,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
|
||||
select tmsub.id,tmember.project_name,tmsub.charge_use,tmember.director_id,su.realname,tmsub.company_name,tmsub.amount_receivable,tmsub.paid_amount,tmsub.invoice_requirements,tmsub.pack,tmsub.in_account,tmsub.make_invoice,tmsub.mail,tmsub.create_time,5
|
||||
from tb_member_project tmember
|
||||
left join sys_user su on member.director_id = su.id
|
||||
inner join tb_member_project_subitem tmsub on tmember.id=tmsub.project_id
|
||||
where
|
||||
tmsub.amount_receivable <![CDATA[<>]]> 0
|
||||
|
||||
@@ -32,31 +32,36 @@ public class RemindersAllJob implements Job {
|
||||
private SendMessageService sendMessageService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
// 调用催款
|
||||
List<PayCommonProject> list = projectReceivableNotEqualsPaidService.queryProjectReceivableNotEqualsPaid();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(p->{
|
||||
log.info(p.getChargeProject() + "=============发送消息");
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
if(!StringUtils.isBlank(p.getEmail())){
|
||||
sendMessageDTO.setEmail(PasswordUtil.decrypt(p.getEmail()));
|
||||
}
|
||||
if(!StringUtils.isBlank(p.getPhone())){
|
||||
sendMessageDTO.setPhone(PasswordUtil.decrypt(p.getPhone()));
|
||||
sendMessageDTO.setToUser(PasswordUtil.decrypt(p.getPhone()));
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("projectName",p.getChargeProject());
|
||||
sendMessageDTO.setFromUser(ProjectCommon.ADMIN);
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG11.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id",p.getId());
|
||||
sendMessageDTO.setBusId(json.toJSONString());
|
||||
sendMessageService.SendMessageJobService(sendMessageDTO);
|
||||
});
|
||||
public void execute(JobExecutionContext jobExecutionContext) {
|
||||
try {
|
||||
// 调用催款
|
||||
List<PayCommonProject> list = projectReceivableNotEqualsPaidService.queryProjectReceivableNotEqualsPaid();
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(p->{
|
||||
// 发送消息
|
||||
SendMessageDTO sendMessageDTO = new SendMessageDTO();
|
||||
if(!StringUtils.isBlank(p.getEmail())){
|
||||
sendMessageDTO.setEmail(PasswordUtil.decrypt(p.getEmail()));
|
||||
}
|
||||
if(!StringUtils.isBlank(p.getPhone())){
|
||||
sendMessageDTO.setPhone(PasswordUtil.decrypt(p.getPhone()));
|
||||
sendMessageDTO.setToUser(PasswordUtil.decrypt(p.getPhone()));
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("projectName",p.getChargeProject());
|
||||
sendMessageDTO.setFromUser(ProjectCommon.ADMIN);
|
||||
sendMessageDTO.setTemplateCode(CompanyMessageEnums.MSG11.getCode());
|
||||
sendMessageDTO.setTemplateParam(map);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("id",p.getId());
|
||||
sendMessageDTO.setBusId(json.toJSONString());
|
||||
log.info(p.getChargeProject() + "=============发送消息" + sendMessageDTO);
|
||||
sendMessageService.SendMessageJobService(sendMessageDTO);
|
||||
});
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("定时任务异常:",e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user