This commit is contained in:
zhangqinlin
2021-10-15 18:56:40 +08:00
parent aa05d36849
commit 8ead58a44e
15 changed files with 1097 additions and 215 deletions
@@ -45,7 +45,7 @@ public class ValidUtil {
for (ConstraintViolation<Object> constraintViolation : set) {
msg.append(constraintViolation.getMessage()).append("");
}
if (StringUtils.isNotBlank(msg)) {
if (StringUtils.isBlank(msg)) {
throw new JeroBootException(msg.substring(0,msg.length()-1));
}
}
@@ -17,6 +17,7 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.oConvertUtils;
import com.jero.data.entity.*;
import com.jero.data.entity.DTO.PayCaseCommitteeDTO;
import com.jero.data.entity.DTO.PayCaseCommitteeUpdateDTO;
@@ -81,7 +82,8 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String userId = sysUser.getId();
Page<PayCaseCommittee> page = new Page<>(pageNo, pageSize);
IPage<PayCaseCommittee> pageList = payCaseCommitteeService.pageForList(page,name,userId);
String s = oConvertUtils.replaceAllPercent(name);
IPage<PayCaseCommittee> pageList = payCaseCommitteeService.pageForList(page,s,userId);
return Result.OK(pageList);
}
/**
@@ -93,7 +95,9 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
@ApiOperation(value="分标委表-企业端通过分标委id查询详情", notes="分标委表-企业端通过分标委id查询详情")
@GetMapping(value = "/detail")
public Result<?> detail(@RequestParam(name="id",required = true) String id) {
DetailForCaseCommittee detailForCaseCommittee = payCaseCommitteeService.detail(id);
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
DetailForCaseCommittee detailForCaseCommittee = payCaseCommitteeService.detail(id,sysUser.getId());
return Result.OK(detailForCaseCommittee);
}
@@ -187,7 +191,7 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
payCaseCommitteeService.updateById(payCaseCommittee);
return Result.OK("编辑成功!");
}else {
return Result.error("分标委名已存在");
return Result.error("分标委名已存在");
}
}
@@ -206,7 +210,7 @@ public class PayCaseCommitteeController extends JeroController<PayCaseCommittee,
queryWrapper.eq(PayCaseCommitteeSubitem::getCommitteeId,id);
List<PayCaseCommitteeSubitem> payCaseCommitteeSubitems = payCaseCommitteeSubitemService.selectList(queryWrapper);
if(payCaseCommitteeSubitems.size()>0){
return Result.error("群组下还有数据,不可删除!");
return Result.error("分标委下级仍有数据,不可删除!");
}payCaseCommitteeService.removeById(id);
return Result.OK("删除成功!");
}
@@ -19,6 +19,6 @@ public interface PayCaseCommitteeMapper extends BaseMapper<PayCaseCommittee> {
IPage<PayCaseCommittee> pageForList(Page<PayCaseCommittee> page, @Param("name") String name,@Param("userId") String userId);
DetailForCaseCommittee detail(@Param("id")String id);
DetailForCaseCommittee detail(@Param("id")String id,@Param("userId") String userId);
}
@@ -21,8 +21,8 @@
<select id="detail" resultMap="searchFile">
SELECT pcc.name,ossf.id as fileId,ossf.file_name as fileName FROM pay_case_committee pcc left join pay_working_group_distribution_record pwgdr on(pcc.id=pwgdr.project_id) left join oss_file
ossf on(pwgdr.file_id=ossf.id) where pcc.id=#{id}
</select>
ossf on(pwgdr.file_id=ossf.id) where pcc.id=#{id} and pwgdr.contacts_id=#{userId} group by pwgdr.id
</select>
<!-- <select id="listForChildren" resultType="com.jero.data.entity.Files">-->
<!-- select ossf.id as fileId,ossf.file_name as fileName from pay_case_committee_subitem pccs left join pay_working_group_distribution_record pwgdr on(pccs.id=pwgdr.project_id) left join oss_file-->
<!-- ossf on(pwgdr.file_id=ossf.id) where pccs.committee_id=#{id} and pccs.contacts_id=#{userId}-->
@@ -31,5 +31,5 @@ public interface IPayCaseCommitteeService extends IService<PayCaseCommittee> {
* @param id
* @return
*/
DetailForCaseCommittee detail(String id);
DetailForCaseCommittee detail(String id,String userId);
}
@@ -44,7 +44,7 @@ public class PayCaseCommitteeServiceImpl extends ServiceImpl<PayCaseCommitteeMap
* @return
*/
@Override
public DetailForCaseCommittee detail(String id) {
return payCaseCommitteeMapper.detail(id);
public DetailForCaseCommittee detail(String id,String userId) {
return payCaseCommitteeMapper.detail(id,userId);
}
}
@@ -135,17 +135,7 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
}
IPage<PayMailBill> pageList = payMailBillService.pageList(page, queryWrapper);
if (!CollectionUtils.isEmpty(pageList.getRecords())) {
try {
pageList.getRecords().forEach(p -> {
if (!org.apache.commons.lang3.StringUtils.isBlank(p.getContactMobile())) {
p.setContactMobile(PasswordUtil.decrypt(p.getContactMobile()));
}
});
} catch (Exception e) {
log.error("手机号解密异常!", e);
}
}
getMobile(pageList.getRecords());
return Result.OK(pageList);
}
@@ -343,26 +333,16 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
queryWrapper.le("send_date", calendar.getTime());
}
if (ObjectUtil.isNotEmpty(payMailBillSearch.getChargeCompanyName())){
queryWrapper.like("charge_company_name",oConvertUtils.replaceAllPercent(payMailBillSearch.getChargeCompanyName()));
queryWrapper.like("charge_company_name",payMailBillSearch.getChargeCompanyName());
}
if (ObjectUtil.isNotEmpty(payMailBillSearch.getPrincipalId())){
queryWrapper.eq("principal_id",payMailBillSearch.getPrincipalId());
}
if (ObjectUtil.isNotEmpty(payMailBillSearch.getProjectName())){
queryWrapper.like("project_name",oConvertUtils.replaceAllPercent(payMailBillSearch.getProjectName()));
queryWrapper.like("project_name",payMailBillSearch.getProjectName());
}
List<PayMailBill> pageList = payMailBillService.list(queryWrapper);
if (!CollectionUtils.isEmpty(pageList)) {
try {
pageList.forEach(p -> {
if (!org.apache.commons.lang3.StringUtils.isBlank(p.getContactMobile())) {
p.setContactMobile(PasswordUtil.decrypt(p.getContactMobile()));
}
});
} catch (Exception e) {
log.error("手机号解密异常!", e);
}
}
getMobile(pageList);
return AmountUtil.exportListXls(pageList,PayMailBill.class,"邮寄票据");
}else {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(ids.split(",")));
@@ -370,17 +350,7 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
List<PayMailBill> list = payMailBillService.listByIds(strings);
if (!CollectionUtils.isEmpty(list)) {
try {
list.forEach(p -> {
if (!org.apache.commons.lang3.StringUtils.isBlank(p.getContactMobile())) {
p.setContactMobile(PasswordUtil.decrypt(p.getContactMobile()));
}
});
} catch (Exception e) {
log.error("手机号解密异常!", e);
}
}
getMobile(list);
return AmountUtil.exportListXls(list,PayMailBill.class,"邮寄票据");
}
@@ -388,5 +358,19 @@ public class PayMailBillController extends JeroController<PayMailBill, IPayMailB
}
private void getMobile(List<PayMailBill> list) {
if (!CollectionUtils.isEmpty(list)) {
try {
list.forEach(p -> {
if (!org.apache.commons.lang3.StringUtils.isBlank(p.getContactMobile())) {
p.setContactMobile(PasswordUtil.decrypt(p.getContactMobile()));
}
});
} catch (Exception e) {
log.error("手机号解密异常!", e);
}
}
}
}
@@ -9,6 +9,8 @@ import com.jero.project.entity.PayWorkingGroup;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jero.statistics.entity.*;
import org.apache.ibatis.annotations.Param;
import java.util.ArrayList;
import java.util.List;
/**
@@ -69,6 +71,16 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
*/
List<PayWorkingGroupStatistics> queryPageListForStatistics(@Param("payWorkingGroupSearch") PayWorkingGroupSearch payWorkingGroupSearch,@Param("ids") List<String> ids);
/**
* @Description 工作组统计导出ids
* @Author zql
* @Date 2021/9/13
* @Param
* @Return
* @Exception
*/
List<PayWorkingGroupStatistics> queryPageListForStatisticsIds(@Param("payWorkingGroupSearch") PayWorkingGroupSearch payWorkingGroupSearch,@Param("ids") List<String> ids,@Param("idss") List<String> idss);
List<String> getGroupList();
/**
* @Description 全所统计
@@ -98,6 +110,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
* @Exception
*/
IPage<AllProjectStatistics> queryPageList3( Page<AllProjectStatistics> page,@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch,@Param("idList") List<String> idList);
List<AllProjectStatistics> queryPageListExcel(@Param(value = "allProjectStatisticsSearch") AllProjectStatisticsSearch allProjectStatisticsSearch,@Param("idList") List<String> idList,@Param("ids") List<String> ids);
@@ -153,6 +166,7 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
*/
IPage<CompanyComeMoneyDetail> queryPageListForCompanyDetail(Page<CompanyComeMoneyDetail> page,@Param("CompanyComeMoneyDetailSearch") CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch,@Param("idList") List<String> idList );
/**
* 企业来款详情导出
* @param
@@ -162,6 +176,8 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<CompanyComeMoneyDetail> queryPageListForCompanyDetail(@Param("CompanyComeMoneyDetailSearch") CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch,@Param("idList") List<String> idList);
List<PrincipalPeopleList> queryPageListForPrincipalFirstPage();
List<PayWorkingGroupStatistics> queryPageListForStatisticsFirstPage();
@@ -169,4 +185,11 @@ public interface PayWorkingGroupMapper extends BaseMapper<PayWorkingGroup> {
List<CompanyComeMoneyList> queryPageListForCompanyFirstPage();
List<DepartStatistics> queryPageListForDepartFirstPage();
List<PrincipalPeopleDetail> queryPageListForPrincipalDetailTwo(@Param("principalPeopleDetailSearch") PrincipalPeopleDetailSearch principalPeopleDetailSearch,@Param("ids") ArrayList<String> ids);
List<PrincipalPeopleList> queryPageListForPrincipalIds(@Param("principalPeopleSearch") PrincipalPeopleSearch principalPeopleSearch,@Param("idList") List<String> idList,@Param("ids") List<String> ids);
List<CompanyComeMoneyList> queryPageListForCompanyIds(@Param("companyComeMoneySearch") CompanyComeMoneySearch companyComeMoneySearch,@Param("idList") List<String> idList,@Param("ids") List<String> ids);
}
@@ -146,6 +146,56 @@
</where>) ppp order by createTime desc
</select>
<!-- 工作组统计ids-->
<select id="queryPageListForStatisticsIds" resultType="com.jero.project.entity.PayWorkingGroupStatistics">
select ppp.id,ppp.workGroup, ppp.allMoney,ppp.comeAllMoney,ppp.moneyRate from (SELECT
pwg.id,
pwg.working_group_project AS workGroup,
pwg.principal_id_a as principalId,
pwgs.allMoney,
pwgs.comeAllMoney,
pwgs.createTime,
CONCAT(CAST(ROUND((pwgs.comeAllMoney/pwgs.allMoney)*100,2) AS CHAR),'%') AS moneyRate
FROM pay_working_group pwg left join (select pwg1s.id,pwg1s.create_time AS createTime,working_group_id,SUM(receivable_amount) AS
allMoney,SUM(paid_amount) AS comeAllMoney
from pay_working_group_subitem pwg1s
inner join pay_payment_record ppr on(pwg1s.id=ppr.project_id)
WHERE ppr.payment_date like concat('%',#{payWorkingGroupSearch.year},'%') group by pwg1s.working_group_id)
pwgs on(pwg.id=pwgs.working_group_id)
<where>
<if test="ids != null and ids != ''">
pwg.principal_id_a in
<foreach item="item" open="(" separator="," close=")" collection="ids">
#{item}
</foreach>
</if>
<if test="idss != null and idss != ''">
pwg.id in
<foreach item="items" open="(" separator="," close=")" collection="idss">
#{items}
</foreach>
</if>
<if test="payWorkingGroupSearch.workGroup != null and payWorkingGroupSearch.workGroup != ''">
and pwg.working_group_project LIKE concat('%',concat(#{payWorkingGroupSearch.workGroup},'%'))
</if>
<choose>
<when test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != '' and payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
AND if(pwgs.allMoney IS NULL OR pwgs.allMoney = '', 0, pwgs.allMoney ) >= #{payWorkingGroupSearch.allMoney} and if(pwgs.allMoney IS NULL OR pwgs.allMoney = '', 0, pwgs.allMoney ) <![CDATA[<]]>=
#{payWorkingGroupSearch.allMoneyTwo}
</when>
<otherwise>
<if test="payWorkingGroupSearch.allMoney != null and payWorkingGroupSearch.allMoney != ''">
AND if(pwgs.allMoney IS NULL OR pwgs.allMoney = '', 0, pwgs.allMoney ) >= #{payWorkingGroupSearch.allMoney}
</if>
<if test="payWorkingGroupSearch.allMoneyTwo != null and payWorkingGroupSearch.allMoneyTwo != ''">
AND if(pwgs.allMoney IS NULL OR pwgs.allMoney = '', 0, pwgs.allMoney ) <![CDATA[<]]>= #{payWorkingGroupSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>) ppp order by createTime desc
</select>
<select id="queryPageListForStatisticsFirstPage" resultType="com.jero.project.entity.PayWorkingGroupStatistics">
select ppp.id,ppp.workGroup, ppp.allMoney,ppp.comeAllMoney,ppp.moneyRate from (select pwg1.id,
pwg1.workGroup,
@@ -504,6 +554,344 @@
</select>
<select id="queryPageListExcel" resultType="com.jero.statistics.entity.AllProjectStatistics">
select pp.id as projectId,pp.projectName, principalName, chargeCompanyTemporaryName, allMoney, comeAllMoney, chargeUse, depart, createTime,pp.id from
(SELECT
pwgs.id,
pwg.working_group_project AS projectName,
pwg.principal_name_a as principalName,
pwgs.charge_company_temporary_name AS chargeCompanyTemporaryName,
pwgs.receivable_amount as allMoney,
pwgs.paid_amount as comeAllMoney,
pwgs.charge_use as chargeUse,
sd.depart_name as depart,
pwgs.create_time as createTime
FROM pay_working_group pwg right join pay_working_group_subitem pwgs on(pwg.id=pwgs.working_group_id)
left JOIN sys_user su on(pwg.principal_id_a=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="idList != null and idList != ''">
pwg.principal_id_a in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="ids!= null and ids != ''"> where pwgs.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND pwg.working_group_project LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND pwgs.in_account LIKE
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND su.org_code =#{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND pwgs.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND pwgs.charge_company_temporary_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND pwg.principal_id_a=#{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pwgs.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pwgs.receivable_amount <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND pwgs.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pwgs.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union all
SELECT
pcp.id,
pcp.charge_project AS projectName,
pcp.principal_name as principalName,
pcp.charge_company_temporary_name AS chargeCompanyTemporaryName,
pcp.receivable_amount as allMoney,
pcp.paid_amount as comeAllMoney,
pcp.charge_use as chargeUse,
sd.depart_name as depart,
pcp.create_time as createTime
FROM pay_common_project pcp left JOIN sys_user su on(pcp.principal_id=su.id) left join sys_depart sd
on(su.org_code=sd.org_code)
<where>
<if test="ids!= null and ids != ''"> where pcp.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<if test="idList != null and idList != ''">
pcp.principal_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND pcp.charge_project LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND pcp.in_account LIKE
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND pcp.charge_company_temporary_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND su.org_code =#{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND pcp.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND pcp.principal_id=#{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pcp.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney} and pcp.receivable_amount
<![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND pcp.receivable_amount >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pcp.receivable_amount <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union all
SELECT
pmps.id,
pmp.project_name AS projectName,
pmp.director_name as principalName,
pmps.company_name AS chargeCompanyTemporaryName,
pmps.amount_receivable as allMoney,
pmps.paid_amount as comeAllMoney,
pmps.charge_use as chargeUse,
sd.depart_name as depart,
pmps.create_time as createTime
FROM pay_member_project pmp right join pay_member_project_subitem pmps on(pmp.id=pmps.project_id)
left JOIN sys_user su on(pmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="ids!= null and ids != ''"> where pmps.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<if test="idList != null and idList != ''">
pmp.director_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND pmp.project_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND pmps.in_account LIKE
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND su.org_code =#{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND pmps.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND pmps.company_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND pmp.director_id=#{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pmps.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pmps.amount_receivable <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND pmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union all
SELECT
pms.id,
pm.meeting_name AS projectName,
pm.director_name as principalName,
pms.company_name AS chargeCompanyTemporaryName,
pms.amount_receivable as allMoney,
pms.paid_amount as comeAllMoney,
pms.charge_use as chargeUse,
sd.depart_name as depart,
pms.create_time as createTime
FROM pay_meeting pm right join pay_meeting_situation pms on(pm.id=pms.meeting_id)
left JOIN sys_user su on(pm.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="ids!= null and ids != ''"> where pms.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<if test="idList != null and idList != ''">
pm.director_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND pm.meeting_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND pms.in_account LIKE
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND su.org_code =#{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND pms.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND pms.company_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND pm.director_id=#{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pms.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and pms.amount_receivable <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND pms.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND pms.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union all
SELECT
tmps.id,
tmp.project_name AS projectName,
"" as principalName,
tmps.company_name AS chargeCompanyTemporaryName,
tmps.amount_receivable as allMoney,
tmps.paid_amount as comeAllMoney,
tmps.charge_use as chargeUse,
sd.depart_name as depart,
tmps.create_time as createTime
FROM tb_member_project tmp left join tb_member_project_subitem tmps on(tmp.id=tmps.project_id)
left JOIN sys_user su on(tmps.liaison_man_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="ids!= null and ids != ''"> where tmps.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<!--标协项目没有负责人所以除最高权限都查不到 -->
<if test="idList != null and idList != ''">
tmps.id=99999999999999999999999
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND tmp.project_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.projectName},'%'))
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND tmps.in_account LIKE
concat('%',concat(#{allProjectStatisticsSearch.payStatue},'%'))
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND tmp.id=999999999999999999999
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND su.org_code =#{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND tmps.charge_use=#{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND tmps.company_name LIKE
concat('%',concat(#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%'))
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND tmps.pack=#{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND tmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney} and tmps.amount_receivable <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
AND tmps.amount_receivable >= #{allProjectStatisticsSearch.allMoney}
</if>
<if test="allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND tmps.amount_receivable <![CDATA[<]]>= #{allProjectStatisticsSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>) pp
inner join
(
select pwgs.id as id
from pay_working_group_subitem pwgs
inner join pay_payment_record ppr on(pwgs.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{allProjectStatisticsSearch.year},'%')
GROUP BY pwgs.id
union ALL
SELECT
pcp.id as id
FROM pay_common_project pcp inner JOIN pay_payment_record ppr on(pcp.id=ppr.project_id) WHERE ppr.payment_date like concat('%',#{allProjectStatisticsSearch.year},'%')
group by pcp.id
union all
SELECT
pmps.id as id from
pay_member_project_subitem pmps inner join pay_payment_record ppr on(pmps.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{allProjectStatisticsSearch.year},'%')
group by pmps.id
union all
SELECT
pms.id from pay_meeting_situation pms inner join pay_payment_record ppr on(pms.id=ppr.project_id)
WHERE ppr.payment_date like concat('%',#{allProjectStatisticsSearch.year},'%')
group by pms.id
union all
SELECT
tmps.id from tb_member_project_subitem tmps inner join pay_payment_record ppr on(tmps.id=ppr.project_id)
WHERE ppr.payment_date like concat('%',#{allProjectStatisticsSearch.year},'%')
group by tmps.id
) pprr on(pp.id=pprr.id) group by pp.id order by pp.createTime
</select>
<!-- 部门统计-->
<select id="queryPageListForDepartFirstPage" resultType="com.jero.statistics.entity.DepartStatistics">
select sum(pppp.comeAllMoney) as comeAllMoney,sum(pppp.allMoney) as allMoney,sd.depart_name as departName from (select principalId, principalName,allMoney,comeAllMoney,createTime,
@@ -594,8 +982,8 @@
<!--个人来款统计-->
<select id="queryPageListForPrincipal" resultType="com.jero.statistics.entity.PrincipalPeopleList">
<!--个人来款统计导出ids-->
<select id="queryPageListForPrincipalIds" resultType="com.jero.statistics.entity.PrincipalPeopleList">
select principalId, principalName,allMoney,comeAllMoney,createTime,
CONCAT(CAST(ROUND((comeAllMoney/allMoney)*100,2) AS CHAR),'%') AS finishRate from
(select
@@ -735,6 +1123,168 @@
</where> group by pm.director_id) pp
group by pp.principalId order by pp.createTime) ppp
<where>
<if test="ids!= null and ids != ''"> where ppp.principalId in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
<choose>
<when test="principalPeopleSearch.allMoney != null and principalPeopleSearch.allMoney != '' and principalPeopleSearch.allMoneyTwo != null and principalPeopleSearch.allMoneyTwo != ''">
ppp.allMoney >= #{principalPeopleSearch.allMoney} and ppp.allMoney <![CDATA[<]]>=
#{principalPeopleSearch.allMoneyTwo}
</when>
<otherwise>
<if test="principalPeopleSearch.allMoney != null and principalPeopleSearch.allMoney != ''">
AND ppp.allMoney >= #{principalPeopleSearch.allMoney}
</if>
<if test="principalPeopleSearch.allMoneyTwo != null and principalPeopleSearch.allMoneyTwo != ''">
AND ppp.allMoney <![CDATA[<]]>= #{principalPeopleSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
</select>
<!--个人来款统计-->
<select id="queryPageListForPrincipal" resultType="com.jero.statistics.entity.PrincipalPeopleList">
select principalId, principalName,allMoney,comeAllMoney,createTime,
CONCAT(CAST(ROUND((comeAllMoney/allMoney)*100,2) AS CHAR),'%') AS finishRate from
(select
principalId,principalName,SUM(allMoney) as allMoney,sum(comeAllMoney) as comeAllMoney,
createTime
from
(SELECT
pwg.principal_id_a as principalId,
pwg.principal_name_a as principalName,
sum(pwgs.allMoney) as allMoney,
sum(pwgs.comeAllMoney) as comeAllMoney,
pwg.create_time as createTime
FROM pay_working_group pwg
right JOIN (
select id,working_group_id,SUM(receivable_amount) AS allMoney,SUM(paid_amount) AS comeAllMoney
from (select
pwg1s.id,working_group_id,receivable_amount,paid_amount
from pay_working_group_subitem pwg1s inner join pay_payment_record ppr on(pwg1s.id=ppr.project_id)
WHERE ppr.payment_date like concat('%',#{principalPeopleSearch.year},'%') group by pwg1s.id) pwgs2
GROUP BY pwgs2.working_group_id
) pwgs
ON (pwg.id=pwgs.working_group_id)
left JOIN sys_user su on(pwg.principal_id_a=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="idList != null and idList != ''">
pwg.principal_id_a in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="principalPeopleSearch.principalId != null and principalPeopleSearch.principalId != ''">
AND pwg.principal_id_a=#{principalPeopleSearch.principalId}
</if>
<if test="principalPeopleSearch.departCode != null and principalPeopleSearch.departCode != ''">
AND su.org_code =#{principalPeopleSearch.departCode}
</if>
</where> GROUP BY pwg.principal_id_a
union all
SELECT
pcp1.principal_id as principalId,
pcp1.principal_name as principalName,
sum(pcp1.receivable_amount) as allMoney,
sum(pcp1.paid_amount) as comeAllMoney,
pcp1.create_time as createTime
FROM
(select pcp.principal_id,pcp.principal_name,pcp.receivable_amount,pcp.paid_amount,pcp.create_time from
pay_common_project pcp inner join pay_payment_record ppr on(pcp.id=ppr.project_id)
where
ppr.payment_date like
concat('%',#{principalPeopleSearch.year},'%')
group by pcp.id
) pcp1
left JOIN sys_user su on(pcp1.principal_id=su.id) left join sys_depart sd
on(su.org_code=sd.org_code)
<where>
<if test="idList != null and idList != ''">
pcp1.principal_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="principalPeopleSearch.departCode != null and principalPeopleSearch.departCode != ''">
AND su.org_code =#{principalPeopleSearch.departCode}
</if>
<if test="principalPeopleSearch.principalId != null and principalPeopleSearch.principalId != ''">
AND pcp1.principal_id=#{principalPeopleSearch.principalId}
</if>
</where> group by pcp1.principal_id
union all
select
pmp.director_id as principalId,
pmp.director_name as principalName,
SUM(pmps.allMoney) AS allMoney,
SUM(pmps.comeAllMoney) AS comeAllMoney,
pmp.create_time as createTime
FROM pay_member_project pmp
right join (
select id,projectId,sum(amount_receivable) AS allMoney,sum(paid_amount) AS comeAllMoney from(
select pmp1s.id,pmp1s.project_id as projectId,amount_receivable,paid_amount from
pay_member_project_subitem pmp1s
inner join pay_payment_record ppr on(pmp1s.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{principalPeopleSearch.year},'%')
GROUP BY pmp1s.id
) pmp1s group by pmp1s.projectId ) pmps on(pmp.id=pmps.projectId)
left JOIN sys_user su on(pmp.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="idList != null and idList != ''">
pmp.director_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="principalPeopleSearch.departCode != null and principalPeopleSearch.departCode != ''">
AND su.org_code =#{principalPeopleSearch.departCode}
</if>
<if test="principalPeopleSearch.principalId != null and principalPeopleSearch.principalId != ''">
AND pmp.director_id=#{principalPeopleSearch.principalId}
</if>
</where> group by pmp.director_id
union all
SELECT
pm.director_id as principalId,
pm.director_name as principalName,
sum(pms.allMoney) as allMoney,
sum(pms.comeAllMoney) as comeAllMoney,
pm.create_time as createTime
FROM pay_meeting pm right join (
select id,meeting_id,SUM(amount_receivable) AS
allMoney,SUM(paid_amount) AS comeAllMoney
from
(select pm1s.id,meeting_id,amount_receivable,paid_amount from pay_meeting_situation pm1s
inner join pay_payment_record ppr on(pm1s.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{principalPeopleSearch.year},'%')
GROUP BY pm1s.id) pms1 group by pms1.meeting_id) pms on(pm.id=pms.meeting_id)
left JOIN sys_user su on(pm.director_id=su.id) left join sys_depart sd on(su.org_code=sd.org_code)
<where>
<if test="idList != null and idList != ''">
pm.director_id in
<foreach item="item" open="(" separator="," close=")" collection="idList">
#{item}
</foreach>
</if>
<if test="principalPeopleSearch.departCode != null and principalPeopleSearch.departCode != ''">
AND su.org_code =#{principalPeopleSearch.departCode}
</if>
<if test="principalPeopleSearch.principalId != null and principalPeopleSearch.principalId != ''">
AND pm.director_id=#{principalPeopleSearch.principalId}
</if>
</where> group by pm.director_id) pp
group by pp.principalId order by pp.createTime) ppp
<where>
<choose>
<when test="principalPeopleSearch.allMoney != null and principalPeopleSearch.allMoney != '' and principalPeopleSearch.allMoneyTwo != null and principalPeopleSearch.allMoneyTwo != ''">
@@ -1012,6 +1562,183 @@
group by pms.id) pprr on(pp.id=pprr.id)
order by pp.createTime
</select>
<!-- 个人来款详情导出ids-->
<select id="queryPageListForPrincipalDetailTwo" resultType="com.jero.statistics.entity.PrincipalPeopleDetail">
select * from (SELECT
pwgs.create_time as createTime,
pwgs.id,
pwg.working_group_project as projectName,
pwg.principal_id_a as principalId,
pwgs.receivable_amount AS allMoney,
pwgs.paid_amount AS comeAllMoney,
pwgs.charge_use as chargeUse
FROM pay_working_group_subitem pwgs
inner join pay_working_group pwg on (pwgs.working_group_id=pwg.id)
<where>
pwg.principal_id_a = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
AND pwg.working_group_project LIKE
concat('%',concat(#{principalPeopleDetailSearch.projectName},'%'))
</if>
<if test="principalPeopleDetailSearch.chargeUse != null and principalPeopleDetailSearch.chargeUse != ''">
AND pwgs.charge_use=#{principalPeopleDetailSearch.chargeUse}
</if>
<if test="principalPeopleDetailSearch.inAccountStatue != null and principalPeopleDetailSearch.inAccountStatue != ''">
AND pwgs.in_account=#{principalPeopleDetailSearch.inAccountStatue}
</if>
<choose>
<when test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != '' and principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pwgs.receivable_amount >= #{principalPeopleDetailSearch.allMoney} and pwgs.receivable_amount <![CDATA[<]]>=
#{principalPeopleDetailSearch.allMoneyTwo}
</when>
<otherwise>
<if test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != ''">
AND pwgs.receivable_amount >= #{principalPeopleDetailSearch.allMoney}
</if>
<if test="principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pwgs.receivable_amount <![CDATA[<]]>= #{principalPeopleDetailSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union ALL
SELECT
pcp.create_time as createTime,
pcp.id,
pcp.charge_project as projectName,
pcp.principal_id as principalId,
pcp.receivable_amount AS allMoney,
pcp.paid_amount AS comeAllMoney,
pcp.charge_use as chargeUse
FROM pay_common_project pcp
<where>
pcp.principal_id = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
AND pcp.charge_project LIKE
concat('%',concat(#{principalPeopleDetailSearch.projectName},'%'))
</if>
<if test="principalPeopleDetailSearch.chargeUse != null and principalPeopleDetailSearch.chargeUse != ''">
AND pcp.charge_use=#{principalPeopleDetailSearch.chargeUse}
</if>
<if test="principalPeopleDetailSearch.inAccountStatue != null and principalPeopleDetailSearch.inAccountStatue != ''">
AND pcp.in_account=#{principalPeopleDetailSearch.inAccountStatue}
</if>
<choose>
<when test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != '' and principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pcp.receivable_amount >= #{principalPeopleDetailSearch.allMoney} and pcp.receivable_amount <![CDATA[<]]>=
#{principalPeopleDetailSearch.allMoneyTwo}
</when>
<otherwise>
<if test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != ''">
AND pcp.receivable_amount >= #{principalPeopleDetailSearch.allMoney}
</if>
<if test="principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pcp.receivable_amount <![CDATA[<]]>= #{principalPeopleDetailSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union ALL
SELECT
pms.create_time as createTime,
pms.id,
pm.meeting_name as projectName,
pm.director_id as principalId,
pms.amount_receivable AS allMoney,
pms.paid_amount AS comeAllMoney,
pms.charge_use as chargeUse
FROM pay_meeting pm inner join pay_meeting_situation pms on(pm.id=pms.meeting_id)
<where>
pm.director_id = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
AND pm.meeting_name LIKE
concat('%',concat(#{principalPeopleDetailSearch.projectName},'%'))
</if>
<if test="principalPeopleDetailSearch.chargeUse != null and principalPeopleDetailSearch.chargeUse != ''">
AND pms.charge_use=#{principalPeopleDetailSearch.chargeUse}
</if>
<if test="principalPeopleDetailSearch.inAccountStatue != null and principalPeopleDetailSearch.inAccountStatue != ''">
AND pms.in_account=#{principalPeopleDetailSearch.inAccountStatue}
</if>
<choose>
<when test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != '' and principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pms.amount_receivable >= #{principalPeopleDetailSearch.allMoney} and pms.amount_receivable <![CDATA[<]]>=
#{principalPeopleDetailSearch.allMoneyTwo}
</when>
<otherwise>
<if test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != ''">
AND pms.amount_receivable >= #{principalPeopleDetailSearch.allMoney}
</if>
<if test="principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pms.amount_receivable <![CDATA[<]]>= #{principalPeopleDetailSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>
union ALL
SELECT
pmps.create_time as createTime,
pmps.id,
pmp.project_name as projectName,
pmp.director_id as principalId,
pmps.amount_receivable AS allMoney,
pmps.paid_amount AS comeAllMoney,
pmps.charge_use as chargeUse
FROM pay_member_project pmp inner join pay_member_project_subitem pmps on(pmp.id=pmps.project_id)
<where>
pmp.director_id = #{principalPeopleDetailSearch.principalNameId}
<if test="principalPeopleDetailSearch.projectName != null and principalPeopleDetailSearch.projectName != ''">
AND pmp.project_name LIKE
concat('%',concat(#{principalPeopleDetailSearch.projectName},'%'))
</if>
<if test="principalPeopleDetailSearch.chargeUse != null and principalPeopleDetailSearch.chargeUse != ''">
AND pmps.charge_use=#{principalPeopleDetailSearch.chargeUse}
</if>
<if test="principalPeopleDetailSearch.inAccountStatue != null and principalPeopleDetailSearch.inAccountStatue != ''">
AND pmps.in_account=#{principalPeopleDetailSearch.inAccountStatue}
</if>
<choose>
<when test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != '' and principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pmps.amount_receivable >= #{principalPeopleDetailSearch.allMoney} and pmps.amount_receivable <![CDATA[<]]>=
#{principalPeopleDetailSearch.allMoneyTwo}
</when>
<otherwise>
<if test="principalPeopleDetailSearch.allMoney != null and principalPeopleDetailSearch.allMoney != ''">
AND pmps.amount_receivable >= #{principalPeopleDetailSearch.allMoney}
</if>
<if test="principalPeopleDetailSearch.allMoneyTwo != null and principalPeopleDetailSearch.allMoneyTwo != ''">
AND pmps.amount_receivable <![CDATA[<]]>= #{principalPeopleDetailSearch.allMoneyTwo}
</if>
</otherwise>
</choose>
</where>) pp <if test="ids!= null and ids != ''"> where pp.id in <foreach collection="ids" item="item" close=")" open="(" separator=",">#{item}</foreach> </if>
inner join
<!-- 判断来款项目的来款年份-->
(select pwgs.id as id
from pay_working_group_subitem pwgs
inner join pay_payment_record ppr on(pwgs.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{principalPeopleDetailSearch.year},'%')
GROUP BY pwgs.id
union ALL
SELECT
pcp.id as id
FROM pay_common_project pcp inner JOIN pay_payment_record ppr on(pcp.id=ppr.project_id) WHERE ppr.payment_date like concat('%',#{principalPeopleDetailSearch.year},'%')
group by pcp.id
union all
SELECT
pmps.id as id from
pay_member_project_subitem pmps inner join pay_payment_record ppr on(pmps.id=ppr.project_id)
WHERE ppr.payment_date like
concat('%',#{principalPeopleDetailSearch.year},'%')
group by pmps.id
union all
SELECT
pms.id as id from pay_meeting_situation pms inner join pay_payment_record ppr on (pms.id=ppr.project_id)
WHERE ppr.payment_date like concat('%',#{principalPeopleDetailSearch.year},'%')
group by pms.id) pprr on(pp.id=pprr.id)
order by pp.createTime
</select>
@@ -1523,4 +2250,5 @@
) pprr on(pp.projectId=pprr.id)
order by pp.createTime
</select>
</mapper>
@@ -9,6 +9,7 @@ import com.jero.project.entity.PayWorkingGroup;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.statistics.entity.*;
import java.util.ArrayList;
import java.util.List;
/**
@@ -103,6 +104,10 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
* 全所查询导出
*/
List<AllProjectStatistics> queryPageListExcel( AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
/**
* 全所查询导出
*/
List<AllProjectStatistics> queryPageListExcel( AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList, List<String> ids);
/**
* 个人来款统计
@@ -119,6 +124,12 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
* @return
*/
List<PrincipalPeopleList> queryPageListForPrincipalExcel(PrincipalPeopleSearch principalPeopleSearch,List<String> idList);
/**
* 个人来款导出excel
* @param idList
* @return
*/
List<PrincipalPeopleList> queryPageListForPrincipalExcel(PrincipalPeopleSearch principalPeopleSearch,List<String> idList,List<String> ids);
/**
* 个人来款详情
* @param
@@ -134,6 +145,14 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
*/
List<PayWorkingGroupStatistics> queryPageListForStatisticsExcel(PayWorkingGroupSearch payWorkingGroupSearch, List<String> idList);
/**
* 工作组统计导出ids
* @param payWorkingGroupSearch
* @param idList
* @return
*/
List<PayWorkingGroupStatistics> queryPageListForStatisticsExcel(PayWorkingGroupSearch payWorkingGroupSearch, List<String> idList, List<String> ids);
/**
* 个人来款详情导出excel
@@ -174,6 +193,7 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
*/
List<CompanyComeMoneyList> queryPageListForCompanyExcel(CompanyComeMoneySearch companyComeMoneySearch, List<String> idList);
/**
* 首页模块统计
* @return
@@ -204,4 +224,5 @@ public interface IPayWorkingGroupService extends IService<PayWorkingGroup> {
* @return
*/
IPage<AllProjectStatistics> queryPageListForProject(Page<AllProjectStatistics> page, AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList);
}
@@ -216,6 +216,15 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
public List<AllProjectStatistics> queryPageListExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageList3(allProjectStatisticsSearch,idList);
}
/**
* 全所统计ecxel全查
* @param allProjectStatisticsSearch
* @return
*/
@Override
public List<AllProjectStatistics> queryPageListExcel(AllProjectStatisticsSearch allProjectStatisticsSearch, List<String> idList, List<String> ids) {
return payWorkingGroupMapper.queryPageListExcel(allProjectStatisticsSearch,idList,ids);
}
/**
* 个人来款统计
@@ -228,6 +237,12 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
public IPage<PrincipalPeopleList> queryPageListForPrincipal(Page<PrincipalPeopleList> page, PrincipalPeopleSearch principalPeopleSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListForPrincipal(page,principalPeopleSearch,idList);
}
@Override
public List<PrincipalPeopleList> queryPageListForPrincipalExcel(PrincipalPeopleSearch principalPeopleSearch, List<String> idList) {
return null;
}
/**
* 个人来款统计导出
* @param idList
@@ -235,8 +250,8 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
* @return
*/
@Override
public List<PrincipalPeopleList> queryPageListForPrincipalExcel(PrincipalPeopleSearch principalPeopleSearch,List<String> idList) {
return payWorkingGroupMapper.queryPageListForPrincipal(principalPeopleSearch,idList);
public List<PrincipalPeopleList> queryPageListForPrincipalExcel(PrincipalPeopleSearch principalPeopleSearch,List<String> idList,List<String> ids) {
return payWorkingGroupMapper.queryPageListForPrincipalIds(principalPeopleSearch,idList,ids);
}
/**
* 个人来款统计详情
@@ -253,6 +268,10 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
public List<PayWorkingGroupStatistics> queryPageListForStatisticsExcel(PayWorkingGroupSearch payWorkingGroupSearch, List<String> idList) {
return payWorkingGroupMapper.queryPageListForStatistics(payWorkingGroupSearch,idList);
}
@Override
public List<PayWorkingGroupStatistics> queryPageListForStatisticsExcel(PayWorkingGroupSearch payWorkingGroupSearch, List<String> idList,List<String> ids) {
return payWorkingGroupMapper.queryPageListForStatisticsIds(payWorkingGroupSearch,idList,ids);
}
/**
* 个人来款详情
@@ -297,6 +316,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
return payWorkingGroupMapper.queryPageListForCompanyDetail(companyComeMoneyDetailSearch,idList);
}
/**
* 企业来款导出
* @param companyComeMoneySearch
@@ -333,6 +353,7 @@ public class PayWorkingGroupServiceImpl extends ServiceImpl<PayWorkingGroupMappe
return payWorkingGroupMapper.queryPageList3(page,allProjectStatisticsSearch,idList);
}
/**
* @Description 校验是存在关联合同的项目
* @Author lqt
@@ -2,6 +2,7 @@ package com.jero.statistics.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
@@ -222,29 +223,72 @@ public class AllProjectStatisticsController {
@AutoLog(value = "全所统计导出-导出统计")
@GetMapping(value = "/statistics/excel")
@ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计")
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch) {
allProjectStatisticsSearch.setProjectName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "selections",required = false) String selections) {
if(StringUtils.isBlank(selections)) {
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
if (pageList != null) {
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
}else {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
}else {
} else {
throw new JeroBootException("权限异常");
}
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
@@ -252,16 +296,16 @@ public class AllProjectStatisticsController {
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch,idList);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList,strings);
if (pageList != null) {
for(AllProjectStatistics s: pageList){
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
}
}
/**
@@ -273,8 +317,8 @@ public class AllProjectStatisticsController {
@GetMapping(value = "/statistics/excelProject")
@ApiOperation(value = "企业项目统计-导出统计", notes = "企业项目统计-导出统计")
public ModelAndView excelProject( AllProjectStatisticsSearch allProjectStatisticsSearch) {
allProjectStatisticsSearch.setProjectName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
@@ -283,28 +327,28 @@ public class AllProjectStatisticsController {
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定工作组内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
}else {
} else {
throw new JeroBootException("权限异常");
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch,idList);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, idList);
if (pageList != null) {
for(AllProjectStatistics s: pageList){
for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
@@ -312,5 +356,7 @@ public class AllProjectStatisticsController {
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "企业来款统计");
}
}
}
@@ -2,6 +2,7 @@ package com.jero.statistics.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
@@ -203,35 +204,36 @@ public class CompanyComeMoneyStatisticsController {
@GetMapping(value = "/excel")
@ApiOperation(value = "企业来款统计-导出统计", notes = "企业来款统计-导出统计")
public ModelAndView excel(CompanyComeMoneySearch companyComeMoneySearch) {
if (companyComeMoneySearch.getYear() == null || companyComeMoneySearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
companyComeMoneySearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
String userId = sysUser.getId();
idList.add(userId);
}else {
throw new JeroBootException("权限异常");
}
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch,idList);
if (companyComeMoneySearch.getYear() == null || companyComeMoneySearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
companyComeMoneySearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, idList);
return AmountUtil.exportListXls(pageList, CompanyComeMoneyList.class, "企业来款统计");
return AmountUtil.exportListXls(pageList, CompanyComeMoneyList.class, "企业来款统计");
}
/**
@@ -242,39 +244,40 @@ public class CompanyComeMoneyStatisticsController {
@GetMapping(value = "/excelDetail")
@ApiOperation(value = "企业来款详情统计-导出统计", notes = "企业来款详情统计-导出统计")
public ModelAndView excelDetail( CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) {
if (companyComeMoneyDetailSearch.getYear() == null || companyComeMoneyDetailSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
companyComeMoneyDetailSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
String userId = sysUser.getId();
idList.add(userId);
}else {
throw new JeroBootException("权限异常");
}
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch,idList);
for(CompanyComeMoneyDetail s: pageList){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyDetail.class, "企业来款详情统计");
if (companyComeMoneyDetailSearch.getYear() == null || companyComeMoneyDetailSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
companyComeMoneyDetailSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, idList);
for (CompanyComeMoneyDetail s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyDetail.class, "企业来款详情统计");
}
}
@@ -2,6 +2,7 @@ package com.jero.statistics.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
@@ -144,48 +145,94 @@ public class PayWorkingGroupStatisticsController {
@AutoLog(value = "工作组项目统计-统计导出excel")
@GetMapping(value = "/exportXls2")
@ApiOperation(value="工作组项目统计-统计导出excel", notes="工作组项目统计-统计导出excel")
public ModelAndView exportXls2( PayWorkingGroupSearch payWorkingGroupSearch) {
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
if(payWorkingGroupSearch.getYear()==null|| payWorkingGroupSearch.getYear().equals("")){
Calendar calendar= Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
payWorkingGroupSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
String userId = sysUser.getId();
idList.add(userId);
public ModelAndView exportXls2( PayWorkingGroupSearch payWorkingGroupSearch, @RequestParam(name = "selections", required = false) String selections) {
if (StringUtils.isBlank(selections)) {
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
if (payWorkingGroupSearch.getYear() == null || payWorkingGroupSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
payWorkingGroupSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList);
//处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if (s.getMoneyRate() == null || s.getMoneyRate().equals("")) {
s.setMoneyRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class, "工作组项目统计");
}else {
throw new JeroBootException("权限异常");
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
if (payWorkingGroupSearch.getYear() == null || payWorkingGroupSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
payWorkingGroupSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, idList,strings);
//处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if (s.getMoneyRate() == null || s.getMoneyRate().equals("")) {
s.setMoneyRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class, "工作组项目统计");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,idList);
//处理为空数据为0
for(PayWorkingGroupStatistics s: pageList){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
if(s.getMoneyRate()== null || s.getMoneyRate().equals("") ) {
s.setMoneyRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class,"工作组项目统计");
}
@@ -205,8 +252,8 @@ public class PayWorkingGroupStatisticsController {
public Result<?> list2(PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "id") String id,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize
) {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize);
if(payWorkingGroupSubletSearch.getYear()==null|| payWorkingGroupSubletSearch.getYear().equals("")){
@@ -3,6 +3,7 @@ package com.jero.statistics.controller;
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.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
@@ -185,35 +186,36 @@ public class PrincipalPeopleStatisticsController {
@GetMapping(value = "/excel")
@ApiOperation(value = "个人来款统计导出-导出统计", notes = "个人来款统计导出-导出统计")
public ModelAndView excel( PrincipalPeopleSearch principalPeopleSearch) {
if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
principalPeopleSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if(roleCodes.contains(constant.BMFZR)&&!(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if(roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN)) {
idList=null;
//企业职员项目负责人
}else if(roleCodes.contains(constant.XMFZR)&&!(roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)||roleCodes.contains(constant.ADMIN))){
String userId = sysUser.getId();
idList.add(userId);
}else {
throw new JeroBootException("权限异常");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch,idList);
if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
principalPeopleSearch.setYear(year);
}
//根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//科长
if (roleCodes.contains(constant.BMFZR) && !(roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String orgCode = sysUser.getOrgCode();
List<SysUser> userList = userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", orgCode));
idList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
//所领导或者超级管理员
} else if (roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN)) {
idList = null;
//企业职员项目负责人
} else if (roleCodes.contains(constant.XMFZR) && !(roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD) || roleCodes.contains(constant.ADMIN))) {
String userId = sysUser.getId();
idList.add(userId);
} else {
throw new JeroBootException("权限异常");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");
}
/**
@@ -224,18 +226,21 @@ public class PrincipalPeopleStatisticsController {
@GetMapping(value = "/excelDetail")
@ApiOperation(value = "个人来款统详情计导出-导出统计", notes = "个人来款统详情计导出-导出统计")
public ModelAndView excelDetail( PrincipalPeopleDetailSearch principalPeopleDetailSearch) {
if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
principalPeopleDetailSearch.setYear(year);
}
List<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetailExcel(principalPeopleDetailSearch);
for(PrincipalPeopleDetail s: pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
principalPeopleDetailSearch.setYear(year);
}
List<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetailExcel(principalPeopleDetailSearch);
for (PrincipalPeopleDetail s : pageList) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
}
}