打包管理添加证书

This commit is contained in:
liangqitao
2021-12-16 15:25:06 +08:00
parent b055733ca4
commit 7758b07c0f
10 changed files with 198 additions and 97 deletions
@@ -11,25 +11,29 @@ public class PackCommon {
*/
public final static Integer PACKAGING1 = 1;
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE1 = "1";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE2 = "2";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE3 = "3";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE4 = "4";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目)
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE5 = "5";
/**
* 项目类型(1:普通项目,2:工作组项目,3:会议项目,4:会员项目,5:标协会员项目,6:证书)
*/
public final static String PROJECT_TYPE6 = "6";
/**
* 来源(1:收入合同,2:打包管理)
*/
@@ -1,18 +1,7 @@
package com.jero.pack.controller;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -22,9 +11,7 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PasswordUtil;
import com.jero.common.util.ValidUtil;
import com.jero.common.util.oConvertUtils;
import com.jero.pack.common.PackCommon;
import com.jero.pack.entity.PayPackCompany;
@@ -35,21 +22,29 @@ import com.jero.pack.vo.PayPackCompanyProjectInput;
import com.jero.pack.vo.PayProjectExcel;
import com.jero.project.entity.PayCommonProject;
import com.jero.project.vo.PayCommonProjectOutput;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Description: 打包项目维护
@@ -102,21 +97,21 @@ public class PayPackCompanyProjectController extends JeroController<PayPackCompa
@ApiOperation(value="打包项目维护-列表查询", notes="打包项目维护-列表查询")
@GetMapping(value = "/listAll")
public Result<?> queryListAll(PayPackCompanyProjectInput input) {
if(Objects.isNull(input.getPackId())){
if(Objects.isNull(input.getPackId())){
return Result.error("打包id不能为空");
}
PayPackCompany payPackCompany = payPackCompanyService.getById(input.getPackId());
if(Objects.isNull(payPackCompany)){
}
PayPackCompany payPackCompany = payPackCompanyService.getById(input.getPackId());
if(Objects.isNull(payPackCompany)){
return Result.error("打包企业不存在");
}
}
if(!StringUtils.isBlank(input.getProjectName())){
input.setProjectName(oConvertUtils.replaceAllPercent(input.getProjectName()));
}
input.setCompanyId(payPackCompany.getCompanyId());
input.setPackYear(payPackCompany.getPackYear());
List<PayCommonProject> list = payPackCompanyProjectService.queryListAll(input);
if(!CollectionUtils.isEmpty(list)){
list.forEach(p->{
input.setCompanyId(payPackCompany.getCompanyId());
input.setPackYear(payPackCompany.getPackYear());
List<PayCommonProject> list = payPackCompanyProjectService.queryListAll(input);
if(!CollectionUtils.isEmpty(list)){
list.forEach(p->{
if(!StringUtils.isBlank(p.getPhone())){
p.setPhone(PasswordUtil.decrypt(p.getPhone()));
}
@@ -129,9 +124,9 @@ public class PayPackCompanyProjectController extends JeroController<PayPackCompa
if(Objects.isNull(p.getPaidAmount())){
p.setPaidAmount(new BigDecimal("0.00"));
}
});
}
return Result.OK(list);
});
}
return Result.OK(list);
}
@@ -48,7 +48,7 @@
<!--工作组项目-->
UNION ALL
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,'',''
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
@@ -66,7 +66,7 @@
<!-- 会议项目-->
UNION ALL
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,''
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
@@ -85,7 +85,7 @@
<!-- 会员项目-->
UNION ALL
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,'',''
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
@@ -103,7 +103,7 @@
<!-- 标协会员项目-->
UNION ALL
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
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
@@ -118,6 +118,24 @@
AND tmember.year = #{year}
</if>
</where>
<!-- 证书 -->
UNION ALL
select tcp.id,tmember.project_name,tcp.invoice_amount,tcp.charge_use,tmember.director_id, su.realname,'',tcp.liaison_man,tcp.company_name,tcp.amount_receivable,
if(tcp.paid_amount is null or tcp.paid_amount = '','0.00',tcp.paid_amount) as paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6,tcp.mobile,tcp.email
from tb_member_project tmember
left join sys_user su on tmember.director_id = su.id
inner join tb_certificate_payment tcp on tmember.id = tcp.project_id
<where>
<if test="companyId != null and companyId != ''">
AND tcp.company_id = #{companyId}
</if>
<if test="projectName != null and projectName != ''">
AND tmember.project_name LIKE CONCAT('%',CONCAT(#{projectName},'%'))
</if>
<if test="year != null and year != ''">
AND tmember.year = #{year}
</if>
</where>
) project
LEFT JOIN pay_pack_company_project ppcp ON project.id = ppcp.project_id
LEFT JOIN pay_pack_company ppc ON ppc.id = ppcp.pack_id and ppc.pack_year =#{packYear}
@@ -248,6 +266,30 @@
AND tmsub.pack = #{pack}
</if>
</where>
<!-- 证书 tcp.mobile,tcp.email -->
<!-- 标协会员项目-->
UNION ALL
select tcp.id,tmember.project_name,tcp.charge_use,tmember.director_id, su.realname,tcp.company_name,tcp.amount_receivable,tcp.paid_amount,tcp.invoice_requirements,tcp.pack,tcp.in_account,tcp.make_invoice,tcp.mail,tcp.create_time,6,tcp.liaison_man
from tb_member_project tmember
left join sys_user su on tmember.director_id = su.id
inner join tb_certificate_payment tcp on tmember.id = tcp.project_id
<where>
<if test="projectId != null and projectId != ''">
AND tcp.id = #{projectId}
</if>
<if test="companyId != null and companyId != ''">
AND tcp.company_id = #{companyId}
</if>
<if test="projectName != null and projectName != ''">
AND tmember.project_name LIKE CONCAT('%',CONCAT(#{projectName},'%'))
</if>
<if test="year != null and year != ''">
AND tmember.year = #{year}
</if>
<if test="pack != null and pack != ''">
AND tcp.pack = #{pack}
</if>
</where>
) project
<if test="packId != null and packId != ''">
WHERE project.id NOT IN (SELECT project_id FROM pay_pack_company_project where pack_id = #{packId})