fix 74230 已经确认收入的打包标协会员项目不允许取消打包

This commit is contained in:
lijiarao
2023-07-28 10:30:12 +08:00
parent abf16edad9
commit cb78be3c9f
3 changed files with 27 additions and 10 deletions
@@ -5,7 +5,7 @@
<select id="queryProject" resultType="com.jero.project.entity.PayCommonProject">
<!-- 普通项目-->
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,'' as mission_and_objectives
,c.tax_rate,c.tax,c.no_tax_amount
,c.tax_rate,c.tax,c.no_tax_amount,c.affirm_income
from pay_common_project c
left join sys_user su on c.principal_id = su.id
<where>
@@ -16,7 +16,7 @@
<!--工作组项目-->
UNION ALL
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,g.mission_and_objectives
,gsub.tax_rate,gsub.tax,gsub.no_tax_amount
,gsub.tax_rate,gsub.tax,gsub.no_tax_amount,affirm_income
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
@@ -28,7 +28,7 @@
<!-- 会议项目-->
UNION ALL
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,'','','','','',''
,sit.tax_rate,sit.tax,sit.no_tax_amount
,sit.tax_rate,sit.tax,sit.no_tax_amount,affirm_income
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
@@ -40,7 +40,7 @@
<!-- 会员项目-->
UNION ALL
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,''
,msub.tax_rate,msub.tax,msub.no_tax_amount
,msub.tax_rate,msub.tax,msub.no_tax_amount,affirm_income
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
@@ -52,7 +52,7 @@
<!-- 标协会员项目-->
UNION ALL
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,'',''
,tmsub.tax_rate,tmsub.tax,tmsub.no_tax_amount
,tmsub.tax_rate,tmsub.tax,tmsub.no_tax_amount,affirm_income
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
@@ -64,7 +64,7 @@
<!-- 标协会员证书项目-->
UNION ALL
select tmps.id,tmember.project_name,tmps.charge_use,tmember.director_id,su.realname,tmps.liaison_man_id,tmps.liaison_man,tmps.company_name,tmps.amount_receivable,tmps.paid_amount,tmps.invoice_requirements,tmps.pack,tmps.in_account,tmps.make_invoice,tmps.mail,tmps.create_time,5,tmps.mobile,tmps.email,'','',tmps.company_id,tmps.payment_method,'','','',tmember.year,'',''
,tmps.tax_rate,tmps.tax,tmps.no_tax_amount
,tmps.tax_rate,tmps.tax,tmps.no_tax_amount,affirm_income
from tb_member_project tmember
left join sys_user su on tmember.director_id = su.id
inner join tb_certificate_payment tmps on tmember.id=tmps.project_id
@@ -25,6 +25,7 @@ import com.jero.pack.service.IPayPackCompanyProjectService;
import com.jero.pack.service.IPayPackCompanyService;
import com.jero.pack.vo.PayPackCompanyProjectInput;
import com.jero.pack.vo.PayProjectExcel;
import com.jero.project.common.PayProjectCommon;
import com.jero.project.entity.PayCommonProject;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@@ -164,18 +165,30 @@ public class PayPackCompanyProjectServiceImpl extends ServiceImpl<PayPackCompany
@Override
@Transactional
public void removePayPackCompanyProject(PayPackCompanyProject payPackCompanyProject) {
String projectId = payPackCompanyProject.getId();
LambdaQueryWrapper<PayPackCompanyProject> query = new LambdaQueryWrapper<>();
query.eq(PayPackCompanyProject::getProjectId,payPackCompanyProject.getId());
query.eq(PayPackCompanyProject::getProjectId, projectId);
List<PayPackCompanyProject> listPayPackCompanyProject = payPackCompanyProjectService.list(query);
if(CollectionUtils.isEmpty(listPayPackCompanyProject)){
throw new JeroBootException("不存在打包项目!");
}
if(Objects.equals(listPayPackCompanyProject.get(0).getCome(),PackCommon.COME1)){
PayPackCompanyProject packCompanyProject = listPayPackCompanyProject.get(0);
Integer projectType = packCompanyProject.getProjectType();
if (Objects.equals(projectType, Integer.parseInt(PayProjectCommon.PROJECT_TYPE5))||
Objects.equals(projectType, Integer.parseInt(PayProjectCommon.PROJECT_TYPE6))){
PayCommonProject payCommonProject = projectDetailMapper.queryProject(projectId);
Integer chargeWay = payCommonProject.getChargeWay();
Integer affirmIncome = payCommonProject.getAffirmIncome();
if(Objects.equals(chargeWay,PayProjectCommon.CHARGE_WAY2) && (1 == affirmIncome || 2 == affirmIncome)){
throw new JeroBootException("已经确认收入的打包标协会员项目不允许取消打包");
}
}
if(Objects.equals(packCompanyProject.getCome(),PackCommon.COME1)){
throw new JeroBootException("此项目已在合同处创建关联,请先从合同处取消关联!");
}
// 更新项目状态
projectPackService.updateProjectStatus(listPayPackCompanyProject.get(0).getProjectId(),String.valueOf(listPayPackCompanyProject.get(0).getProjectType()),String.valueOf(PackCommon.PACKAGING0),payPackCompanyProject.getPackId());
payPackCompanyProjectService.removeById(listPayPackCompanyProject.get(0).getId());
projectPackService.updateProjectStatus(packCompanyProject.getProjectId(),String.valueOf(projectType),String.valueOf(PackCommon.PACKAGING0),payPackCompanyProject.getPackId());
payPackCompanyProjectService.removeById(packCompanyProject.getId());
}
@Override
@@ -79,6 +79,10 @@ public class PayProjectCommon {
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
*/
public final static String PROJECT_TYPE5 = "5";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:标协证书项目)
*/
public final static String PROJECT_TYPE6 = "6";
/**
* 来款用途 :1工作组是标准制定工作组经费
*/