add 统计增加排序功能

This commit is contained in:
lijiarao
2022-06-09 14:31:28 +08:00
parent 33ad3fc154
commit be734da2a2
13 changed files with 621 additions and 688 deletions
+30
View File
@@ -14,6 +14,7 @@ select pp.id as projectId,
year, year,
payStatue, payStatue,
departCode, departCode,
confirmAmount,
principalNameId, principalNameId,
type, type,
pp.pack pp.pack
@@ -31,11 +32,13 @@ from (SELECT pwgs.id,
pwg.year as year, pwg.year as year,
pwgs.in_account as payStatue, pwgs.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pwg.principal_id_a as principalNameId, pwg.principal_id_a as principalNameId,
2 as type, 2 as type,
pwgs.create_time as createTime pwgs.create_time as createTime
FROM pay_working_group pwg FROM pay_working_group pwg
right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id) right join pay_working_group_subitem pwgs on (pwg.id = pwgs.working_group_id)
left JOIN pay_confirm_payment_record pcpr on (pwgs.id = pcpr.project_id)
left JOIN sys_user su on (pwg.principal_id_a = su.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) left join sys_depart sd on (su.org_code = sd.org_code)
union all union all
@@ -53,10 +56,12 @@ from (SELECT pwgs.id,
pcp.year as year, pcp.year as year,
pcp.in_account as payStatue, pcp.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pcp.principal_id as principalNameId, pcp.principal_id as principalNameId,
1 as type, 1 as type,
pcp.create_time as createTime pcp.create_time as createTime
FROM pay_common_project pcp FROM pay_common_project pcp
left JOIN pay_confirm_payment_record pcpr on (pcp.id = pcpr.project_id)
left JOIN sys_user su on (pcp.principal_id = su.id) left JOIN sys_user su on (pcp.principal_id = su.id)
left join sys_depart sd on (su.org_code = sd.org_code) left join sys_depart sd on (su.org_code = sd.org_code)
union all union all
@@ -74,11 +79,13 @@ from (SELECT pwgs.id,
pmp.particular_year as year, pmp.particular_year as year,
pmps.in_account as payStatue, pmps.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pmp.director_id as principalNameId, pmp.director_id as principalNameId,
4 as type, 4 as type,
pmps.create_time as createTime pmps.create_time as createTime
FROM pay_member_project pmp FROM pay_member_project pmp
right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id) right join pay_member_project_subitem pmps on (pmp.id = pmps.project_id)
left JOIN pay_confirm_payment_record pcpr on (pmp.id = pcpr.project_id)
left JOIN sys_user su on (pmp.director_id = su.id) left JOIN sys_user su on (pmp.director_id = su.id)
left join sys_depart sd on (su.org_code = sd.org_code) left join sys_depart sd on (su.org_code = sd.org_code)
union all union all
@@ -96,6 +103,7 @@ from (SELECT pwgs.id,
pm.particular_year as year, pm.particular_year as year,
pms.in_account as payStatue, pms.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
0 as confirmAmount,
pm.director_id as principalNameId, pm.director_id as principalNameId,
3 as type, 3 as type,
pms.create_time as createTime pms.create_time as createTime
@@ -118,6 +126,7 @@ from (SELECT pwgs.id,
tmp.year as year, tmp.year as year,
tmps.in_account as payStatue, tmps.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
0 as confirmAmount,
tmp.director_id as principalNameId, tmp.director_id as principalNameId,
5 as type, 5 as type,
tmps.create_time as createTime tmps.create_time as createTime
@@ -140,6 +149,7 @@ from (SELECT pwgs.id,
tmp.year as year, tmp.year as year,
tcp.in_account as payStatue, tcp.in_account as payStatue,
su.org_code as departCode, su.org_code as departCode,
0 as confirmAmount,
tmp.director_id as principalNameId, tmp.director_id as principalNameId,
6 as type, 6 as type,
tcp.create_time as createTime tcp.create_time as createTime
@@ -151,3 +161,23 @@ from (SELECT pwgs.id,
where pp.allMoney is not null where pp.allMoney is not null
and pp.allMoney != 0 and pp.allMoney != 0
order by pp.createTime; order by pp.createTime;
create table pay_confirm_payment_record
(
id varchar(36) not null comment 'id'
primary key,
create_by varchar(50) null comment '创建人',
create_time datetime null comment '创建日期',
update_by varchar(50) null comment '更新人',
update_time datetime null comment '更新日期',
project_id varchar(50) null comment '项目id',
amount_received decimal(12, 2) null comment '到账金额',
payment_date date null comment '到账日期',
remark varchar(200) null comment '备注'
) comment '确认来款记录表';
alter table pay_common_project
add column confirm_amount decimal(12, 2) null comment '确认金额';
alter table pay_working_group_subitem
add column confirm_amount decimal(12, 2) null comment '确认金额';
alter table pay_member_project_subitem
add column confirm_amount decimal(12, 2) null comment '确认金额';
@@ -134,6 +134,7 @@
sum(comeAllMoney) as comeAllMoney sum(comeAllMoney) as comeAllMoney
from from
v_statistical v_statistical
<where> <where>
type = 2 type = 2
<if test="ids != null and ids != ''"> <if test="ids != null and ids != ''">
@@ -301,8 +302,22 @@
<!-- 全所统计--> <!-- 全所统计-->
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics"> <select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
select projectId,projectName, principalName, chargeCompanyTemporaryName, allMoney, comeAllMoney, chargeUse, depart, createTime, packText,pack select * from
from v_statistical (select projectId,
projectName,
principalName,
chargeCompanyTemporaryName,
allMoney,
comeAllMoney,
chargeUse,
depart,
createTime,
packText,
pack,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney
from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -353,12 +368,38 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="allProjectStatisticsSearch.billYear != null and allProjectStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{allProjectStatisticsSearch.billYear}, '%')
</if>
</where> </where>
group by v.projectId) p
<if test="allProjectStatisticsSearch.column != null and allProjectStatisticsSearch.column != ''">
order by
<if test="allProjectStatisticsSearch.column == 'allMoney'">
allMoney
</if>
<if test="allProjectStatisticsSearch.column == 'comeAllMoney'">
comeAllMoney
</if>
<if test="allProjectStatisticsSearch.column == 'billMoney'">
billMoney
</if>
<if test="allProjectStatisticsSearch.order == 'desc'">
desc
</if>
<if test="allProjectStatisticsSearch.order == 'asc'">
asc
</if>
</if>
</select> </select>
<!-- 全所统计总金额统计--> <!-- 全所统计总金额统计-->
<select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney"> <select id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney">
select sum(allMoney) as allMoney, sum(comeAllMoney) as comeAllMoney from select sum(allMoney) as allMoney,
v_statistical sum(comeAllMoney) as comeAllMoney,
if(sum(pmb.invoice_amount) is null, 0.00, sum(pmb.invoice_amount)) as billMoney
from v_statistical v
left join pay_mail_bill_project pmbp on v.projectId = pmbp.project_id
left join pay_mail_bill pmb on pmbp.bill_id = pmb.id
<where> <where>
<if test="idList != null and idList != ''"> <if test="idList != null and idList != ''">
principalNameId in principalNameId in
@@ -366,37 +407,39 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''"> <if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND projectName LIKE AND projectName LIKE
concat('%',#{allProjectStatisticsSearch.projectName},'%') concat('%', #{allProjectStatisticsSearch.projectName}, '%')
</if> </if>
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''"> <if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
AND year LIKE AND year LIKE
concat(#{allProjectStatisticsSearch.year},'%') concat(#{allProjectStatisticsSearch.year}, '%')
</if> </if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''"> <if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND payStatue LIKE AND payStatue LIKE
concat('%',#{allProjectStatisticsSearch.payStatue},'%') concat('%', #{allProjectStatisticsSearch.payStatue}, '%')
</if> </if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''"> <if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND departCode =#{allProjectStatisticsSearch.departCode} AND departCode = #{allProjectStatisticsSearch.departCode}
</if> </if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''"> <if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND chargeUse=#{allProjectStatisticsSearch.chargeUse} AND chargeUse = #{allProjectStatisticsSearch.chargeUse}
</if> </if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''"> <if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND chargeCompanyTemporaryName LIKE AND chargeCompanyTemporaryName LIKE
concat('%',#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%') concat('%', #{allProjectStatisticsSearch.chargeCompanyTemporaryName}, '%')
</if> </if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''"> <if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND principalNameId=#{allProjectStatisticsSearch.principalNameId} AND principalNameId = #{allProjectStatisticsSearch.principalNameId}
</if> </if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''"> <if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pack=#{allProjectStatisticsSearch.pack} AND pack = #{allProjectStatisticsSearch.pack}
</if> </if>
<choose> <choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''"> <when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND allMoney >= #{allProjectStatisticsSearch.allMoney} and allMoney <![CDATA[<]]>= AND allMoney >= #{allProjectStatisticsSearch.allMoney}
and allMoney <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo} #{allProjectStatisticsSearch.allMoneyTwo}
</when> </when>
<otherwise> <otherwise>
@@ -408,6 +451,9 @@
</if> </if>
</otherwise> </otherwise>
</choose> </choose>
<if test="allProjectStatisticsSearch.billYear != null and allProjectStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{allProjectStatisticsSearch.billYear}, '%')
</if>
</where> </where>
</select> </select>
<!-- 全所统计导出--> <!-- 全所统计导出-->
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
* @author zql * @author zql
* @date 2021/9/17 16:29 * @date 2021/9/17 16:29
*/ */
@Api(tags="全所统计") @Api(tags = "全所统计")
@RestController @RestController
@RequestMapping("/statistics/allProjectStatistics") @RequestMapping("/statistics/allProjectStatistics")
@Slf4j @Slf4j
@@ -64,68 +64,38 @@ public class AllProjectStatisticsController {
@RequiresPermissions("wholeInstituteStatistics:search") @RequiresPermissions("wholeInstituteStatistics:search")
@ApiOperation(value = "全所统计搜索-分页列表查询", notes = "全所统计搜索-详情分页列表查询") @ApiOperation(value = "全所统计搜索-分页列表查询", notes = "全所统计搜索-详情分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> list( AllProjectStatisticsSearch allProjectStatisticsSearch, public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
allProjectStatisticsSearch.setProjectName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName())); allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName())); 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(",")));
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// return Result.OK();
// }
// assert idList != null;
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize); Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, null ); IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page, allProjectStatisticsSearch, null);
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
DecimalFormat df = new DecimalFormat("#,##0.00"); DecimalFormat df = new DecimalFormat("#,##0.00");
if (pageList.getRecords() != null) { if (pageList.getRecords() != null) {
for(AllProjectStatistics s: pageList.getRecords()){ for (AllProjectStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
} }
} }
//处理为空数据为0 //处理为空数据为0
for(AllProjectStatistics s: pageList.getRecords()){ for (AllProjectStatistics s : pageList.getRecords()) {
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch,null); AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList",pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
} }
@@ -144,12 +114,12 @@ public class AllProjectStatisticsController {
public Result<?> listProject(AllProjectStatisticsSearch allProjectStatisticsSearch, public Result<?> listProject(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
allProjectStatisticsSearch.setProjectName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName())); allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName( oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName())); allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
//根据不同角色加载不同列表的参数 //根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码 //判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode(); String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(","))); List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
@@ -157,9 +127,9 @@ public class AllProjectStatisticsController {
if (roleCodes.contains(constant.ADMIN)) { if (roleCodes.contains(constant.ADMIN)) {
idList = null; idList = null;
//部门负责人 //部门负责人
} else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) { } else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员) //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList); List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
//获取本部门成员 //获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList())); idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -168,80 +138,48 @@ public class AllProjectStatisticsController {
return Result.OK(); return Result.OK();
} }
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize); Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,idList); IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page, allProjectStatisticsSearch, idList);
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
// DecimalFormat df = new DecimalFormat("#,##0.00");
if (pageList.getRecords() != null) { if (pageList.getRecords() != null) {
for(AllProjectStatistics s: pageList.getRecords()){ for (AllProjectStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
} }
} }
//处理为空数据为0 //处理为空数据为0
for(AllProjectStatistics s: pageList.getRecords()){ for (AllProjectStatistics s : pageList.getRecords()) {
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch,idList); AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, idList);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList",pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
} }
/** /**
*所领导统计导出 * 所领导统计导出
*
*/ */
@RequiresPermissions("wholeInstituteStatistics:export") @RequiresPermissions("wholeInstituteStatistics:export")
@AutoLog(value = "全所统计导出-导出统计") @AutoLog(value = "全所统计导出-导出统计")
@GetMapping(value = "/statistics/excel") @GetMapping(value = "/statistics/excel")
@ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计") @ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计")
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch, public ModelAndView excel(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "selections",required = false) String selections) { @RequestParam(name = "selections", required = false) String selections) {
if(StringUtils.isBlank(selections)) { if (StringUtils.isBlank(selections)) {
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName())); allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName())); 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(",")));
//
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// ArrayList<AllProjectStatistics> objects = new ArrayList<>();
// return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "所领导统计");
// }
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) { if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR)); String year = String.valueOf(calendar.get(Calendar.YEAR));
@@ -255,44 +193,20 @@ public class AllProjectStatisticsController {
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
//处理为空数据为0 //处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
} }
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计"); return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
}else { } else {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(","))); ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName())); allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName())); 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(",")));
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// ArrayList<AllProjectStatistics> objects = new ArrayList<>();
// return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "所领导统计");
// }
if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) { if (allProjectStatisticsSearch.getYear() == null || allProjectStatisticsSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
@@ -300,17 +214,17 @@ public class AllProjectStatisticsController {
allProjectStatisticsSearch.setYear(year); allProjectStatisticsSearch.setYear(year);
} }
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, null,strings); List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, null, strings);
if (pageList != null) { if (pageList != null) {
for (AllProjectStatistics s : pageList) { for (AllProjectStatistics s : pageList) {
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
//处理为空数据为0 //处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
@@ -320,14 +234,13 @@ public class AllProjectStatisticsController {
} }
/** /**
*企业来款统计 * 企业来款统计
*
*/ */
@RequiresPermissions("projectPaymentStatistics:export") @RequiresPermissions("projectPaymentStatistics:export")
@AutoLog(value = "项目来款统计-导出统计") @AutoLog(value = "项目来款统计-导出统计")
@GetMapping(value = "/statistics/excelProject") @GetMapping(value = "/statistics/excelProject")
@ApiOperation(value = "项目来款统计-导出统计", notes = "项目来款统计-导出统计") @ApiOperation(value = "项目来款统计-导出统计", notes = "项目来款统计-导出统计")
public ModelAndView excelProject( AllProjectStatisticsSearch allProjectStatisticsSearch) { public ModelAndView excelProject(AllProjectStatisticsSearch allProjectStatisticsSearch) {
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName())); allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName())); allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
//根据不同角色加载不同列表的参数 //根据不同角色加载不同列表的参数
@@ -341,9 +254,9 @@ public class AllProjectStatisticsController {
if (roleCodes.contains(constant.ADMIN)) { if (roleCodes.contains(constant.ADMIN)) {
idList = null; idList = null;
//部门负责人 //部门负责人
} else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) { } else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员) //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList); List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
//获取本部门成员 //获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList())); idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -360,10 +273,10 @@ public class AllProjectStatisticsController {
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
//处理为空数据为0 //处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
@@ -373,18 +286,11 @@ public class AllProjectStatisticsController {
@ApiOperation(value = "通过部门id查所有人员", notes = "通过部门id查所有人员") @ApiOperation(value = "通过部门id查所有人员", notes = "通过部门id查所有人员")
@RequestMapping(value = "/listForUserByOrgCode", method = RequestMethod.GET) @RequestMapping(value = "/listForUserByOrgCode", method = RequestMethod.GET)
public Result<?> listForUserByOrgCode(@RequestParam(name = "departCode",required = true) String departCode) { public Result<?> listForUserByOrgCode(@RequestParam(name = "departCode", required = true) String departCode) {
// QueryWrapper<SysDepart> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("org_code",departCode);
// SysDepart one = sysDepartService.getOne(queryWrapper1);
// List<SysDepartTreeModel> sysDepartTreeModels =sysBaseAPI.listSonDepartsByDepId(one.getId());
// SysDepartModel sysDepartModel = sysBaseAPI.selectAllById(one.getId());
// List<String> orgCodes = sysDepartTreeModels.stream().map(s -> s.getOrgCode()).collect(Collectors.toList());
// orgCodes.add(sysDepartModel.getOrgCode());
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>(); QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code",departCode); queryWrapper.eq("org_code", departCode);
queryWrapper.eq("del_flag",0); queryWrapper.eq("del_flag", 0);
queryWrapper.eq("status",1); queryWrapper.eq("status", 1);
List<SysUser> pageList = sysUserService.list(queryWrapper); List<SysUser> pageList = sysUserService.list(queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
@@ -32,7 +32,7 @@ import java.util.*;
* @author zql * @author zql
* @date 2021/9/23 14:07 * @date 2021/9/23 14:07
*/ */
@Api(tags="企业来款统计") @Api(tags = "企业来款统计")
@RestController @RestController
@RequestMapping("/statistics/companyComeMoney") @RequestMapping("/statistics/companyComeMoney")
@Slf4j @Slf4j
@@ -60,27 +60,27 @@ public class CompanyComeMoneyStatisticsController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize); Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,null); IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page, companyComeMoneySearch, null);
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
//处理为空数据为0 //处理为空数据为0
for(CompanyComeMoneyList s: pageList.getRecords()){ for (CompanyComeMoneyList s : pageList.getRecords()) {
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
if(s.getFinishRate()== null || s.getFinishRate().equals("") ) { if (s.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%"); s.setFinishRate("0.00%");
} }
} }
DecimalFormat df = new DecimalFormat("#,##0.00"); DecimalFormat df = new DecimalFormat("#,##0.00");
AllMoney allMoney = payWorkingGroupService.queryPageListForCompany33(companyComeMoneySearch,null); AllMoney allMoney = payWorkingGroupService.queryPageListForCompany33(companyComeMoneySearch, null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList",pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
@@ -99,25 +99,25 @@ public class CompanyComeMoneyStatisticsController {
public Result<?> listForDetail(CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch, public Result<?> listForDetail(CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
companyComeMoneyDetailSearch.setProjectName( oConvertUtils.replaceAllPercent(companyComeMoneyDetailSearch.getProjectName())); companyComeMoneyDetailSearch.setProjectName(oConvertUtils.replaceAllPercent(companyComeMoneyDetailSearch.getProjectName()));
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId()); PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
if(ObjectUtils.isEmpty(byId)){ if (ObjectUtils.isEmpty(byId)) {
return Result.error("企业id错误,无对应企业id"); return Result.error("企业id错误,无对应企业id");
} }
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize); Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,null); IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch, null);
for(CompanyComeMoneyDetail s: pageList.getRecords()){ for (CompanyComeMoneyDetail s : pageList.getRecords()) {
s.setChargeCompanyName(byId.getCompanyName()); s.setChargeCompanyName(byId.getCompanyName());
} }
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
for(CompanyComeMoneyDetail s: pageList.getRecords()){ for (CompanyComeMoneyDetail s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
} }
//处理为空数据为0 //处理为空数据为0
for(CompanyComeMoneyDetail s: pageList.getRecords()) { for (CompanyComeMoneyDetail s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
@@ -125,16 +125,15 @@ public class CompanyComeMoneyStatisticsController {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
} }
AllMoney allMoney = payWorkingGroupService.queryPageListForCompanyDetail33(companyComeMoneyDetailSearch,null); AllMoney allMoney = payWorkingGroupService.queryPageListForCompanyDetail33(companyComeMoneyDetailSearch, null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
} }
/** /**
*企业来款统计 * 企业来款统计
*
*/ */
@RequiresPermissions("companyPaymentStatistics:export") @RequiresPermissions("companyPaymentStatistics:export")
@AutoLog(value = "企业来款统计-导出统计") @AutoLog(value = "企业来款统计-导出统计")
@@ -143,7 +142,7 @@ public class CompanyComeMoneyStatisticsController {
public ModelAndView excel(CompanyComeMoneySearch companyComeMoneySearch) { public ModelAndView excel(CompanyComeMoneySearch companyComeMoneySearch) {
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, null); List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, null);
//处理为空数据为0 //处理为空数据为0
for(CompanyComeMoneyList s: pageList) { for (CompanyComeMoneyList s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
@@ -159,16 +158,15 @@ public class CompanyComeMoneyStatisticsController {
} }
/** /**
*企业来款统计 * 企业来款统计
*
*/ */
@AutoLog(value = "企业来款详情统计-导出统计") @AutoLog(value = "企业来款详情统计-导出统计")
@GetMapping(value = "/excelDetail") @GetMapping(value = "/excelDetail")
@ApiOperation(value = "企业来款详情统计-导出统计", notes = "企业来款详情统计-导出统计") @ApiOperation(value = "企业来款详情统计-导出统计", notes = "企业来款详情统计-导出统计")
public ModelAndView excelDetail( CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) { public ModelAndView excelDetail(CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) {
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, null); List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, null);
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId()); PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
for(CompanyComeMoneyDetail s:pageList){ for (CompanyComeMoneyDetail s : pageList) {
s.setChargeCompanyName(byId.getCompanyName()); s.setChargeCompanyName(byId.getCompanyName());
} }
for (CompanyComeMoneyDetail s : pageList) { for (CompanyComeMoneyDetail s : pageList) {
@@ -176,7 +174,7 @@ public class CompanyComeMoneyStatisticsController {
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
//处理为空数据为0 //处理为空数据为0
for(CompanyComeMoneyDetail ss: pageList) { for (CompanyComeMoneyDetail ss : pageList) {
if (ss.getAllMoney() == null || ss.getAllMoney().equals("")) { if (ss.getAllMoney() == null || ss.getAllMoney().equals("")) {
ss.setAllMoney("0.00"); ss.setAllMoney("0.00");
} }
@@ -34,7 +34,7 @@ import java.util.*;
* @author zql * @author zql
* @date 2021/9/15 8:54 * @date 2021/9/15 8:54
*/ */
@Api(tags="工作组统计") @Api(tags = "工作组统计")
@RestController @RestController
@RequestMapping("/project/payWorkingGroupStatistics") @RequestMapping("/project/payWorkingGroupStatistics")
@Slf4j @Slf4j
@@ -54,112 +54,57 @@ public class PayWorkingGroupStatisticsController {
* @param payWorkingGroupSearch 工作组项目 * @param payWorkingGroupSearch 工作组项目
* @param pageNo 页数 * @param pageNo 页数
* @param pageSize 条数 * @param pageSize 条数
*
*/ */
@RequiresPermissions("workingGroupPaymentStatistics:search") @RequiresPermissions("workingGroupPaymentStatistics:search")
@ApiOperation(value="工作组项目统计-统计分页列表查询", notes="工作组项目统计-统计分页列表查询") @ApiOperation(value = "工作组项目统计-统计分页列表查询", notes = "工作组项目统计-统计分页列表查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public Result<?> list(PayWorkingGroupSearch payWorkingGroupSearch, public Result<?> list(PayWorkingGroupSearch payWorkingGroupSearch,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup())); payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
Page<PayWorkingGroupStatistics> page = new Page<>(pageNo, pageSize); Page<PayWorkingGroupStatistics> page = new Page<>(pageNo, pageSize);
//根据不同角色加载不同列表的参数
// List<String> idList = new ArrayList<>();
// //判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
// LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
// String roleCode = sysUser.getRoleCode();
// List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// return Result.OK();
// }
IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch,null); IPage<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatistics(page, payWorkingGroupSearch, null);
List<PayWorkingGroupStatistics> records = pageList.getRecords(); List<PayWorkingGroupStatistics> records = pageList.getRecords();
for (PayWorkingGroupStatistics payWorkingGroupStatistics:records){ for (PayWorkingGroupStatistics payWorkingGroupStatistics : records) {
if(payWorkingGroupStatistics.getComeAllMoney()==null|| payWorkingGroupStatistics.getComeAllMoney().equals("")){ if (payWorkingGroupStatistics.getComeAllMoney() == null || payWorkingGroupStatistics.getComeAllMoney().equals("")) {
payWorkingGroupStatistics.setComeAllMoney("0.00"); payWorkingGroupStatistics.setComeAllMoney("0.00");
} }
} }
AllMoney allMoney = payWorkingGroupService.queryPageListForStatistics33(payWorkingGroupSearch,null); AllMoney allMoney = payWorkingGroupService.queryPageListForStatistics33(payWorkingGroupSearch, null);
// //计算应收和实收总金额
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = records.stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0.00" : t.getAllMoney())).sum();
// sumTwo = records.stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0.00" : t.getComeAllMoney())).sum();
// }
// DecimalFormat df = new DecimalFormat("#,##0.00");
//处理为空数据为0 //处理为空数据为0
for(PayWorkingGroupStatistics s: pageList.getRecords()){ for (PayWorkingGroupStatistics s : pageList.getRecords()) {
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ){ if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
if(s.getMoneyRate()== null || s.getMoneyRate().equals("") ) { if (s.getMoneyRate() == null || s.getMoneyRate().equals("")) {
s.setMoneyRate("0.00%"); s.setMoneyRate("0.00%");
} }
} }
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("pageList",pageList.setRecords(records)); hashMap.put("pageList", pageList.setRecords(records));
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
return Result.OK(hashMap); return Result.OK(hashMap);
} }
/** /**
* 工作组项目统计-统计导出excel * 工作组项目统计-统计导出excel
*
*/ */
@RequiresPermissions("workingGroupPaymentStatistics:export") @RequiresPermissions("workingGroupPaymentStatistics:export")
@AutoLog(value = "工作组项目统计-统计导出excel") @AutoLog(value = "工作组项目统计-统计导出excel")
@GetMapping(value = "/exportXls2") @GetMapping(value = "/exportXls2")
@ApiOperation(value="工作组项目统计-统计导出excel", notes="工作组项目统计-统计导出excel") @ApiOperation(value = "工作组项目统计-统计导出excel", notes = "工作组项目统计-统计导出excel")
public ModelAndView exportXls2( PayWorkingGroupSearch payWorkingGroupSearch, @RequestParam(name = "selections", required = false) String selections) { public ModelAndView exportXls2(PayWorkingGroupSearch payWorkingGroupSearch, @RequestParam(name = "selections", required = false) String selections) {
if (StringUtils.isBlank(selections)) { if (StringUtils.isBlank(selections)) {
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup())); payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
// //根据不同角色加载不同列表的参数
// List<String> idList = new ArrayList<>(); List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, null);
// //判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// String roleCode = sysUser.getRoleCode();
// List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
// return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
// }
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,null);
//处理为空数据为0 //处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) { for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -173,35 +118,11 @@ public class PayWorkingGroupStatisticsController {
} }
} }
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class, "工作组项目统计"); return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class, "工作组项目统计");
}else { } else {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(","))); ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup())); payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
// //根据不同角色加载不同列表的参数
// List<String> idList = new ArrayList<>();
// //判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// String roleCode = sysUser.getRoleCode();
// List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
// //admin
// if (roleCodes.contains(constant.ADMIN)) {
// idList = null;
// //部门负责人
// } else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) {
// //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
// List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList);
// //获取本部门成员
// idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
//
// idList.addAll(allDepartIds);//项目负责人
// } else if (roleCodes.contains(constant.XMFZR)) {
// String userId = sysUser.getId();
// idList.add(userId);
// } else {
// ArrayList<PayWorkingGroupStatistics> objects = new ArrayList<>();
// return AmountUtil.exportListXls(objects, PayWorkingGroupStatistics.class, "工作组项目统计");
// }
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,null,strings); List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, null, strings);
//处理为空数据为0 //处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) { for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -219,14 +140,12 @@ public class PayWorkingGroupStatisticsController {
} }
/** /**
* 工作组成员统计-详情分页列表查询(传工作组id) * 工作组成员统计-详情分页列表查询(传工作组id)
* *
* @param payWorkingGroupSubletSearch 工作组成员统计搜索 * @param payWorkingGroupSubletSearch 工作组成员统计搜索
* @param pageNo 页数 * @param pageNo 页数
* @param pageSize 条数 * @param pageSize 条数
*
*/ */
@RequiresPermissions("workingGroupPaymentStatistics:detail") @RequiresPermissions("workingGroupPaymentStatistics:detail")
@ApiOperation(value = "工作组成员统计-详情分页列表查询(传工作组id)", notes = "工作组成员统计-详情分页列表查询(传工作组id)") @ApiOperation(value = "工作组成员统计-详情分页列表查询(传工作组id)", notes = "工作组成员统计-详情分页列表查询(传工作组id)")
@@ -238,41 +157,35 @@ public class PayWorkingGroupStatisticsController {
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName())); payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize); Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize);
IPage<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.queryPageList2(page, payWorkingGroupSubletSearch,id); IPage<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.queryPageList2(page, payWorkingGroupSubletSearch, id);
AllMoney allMoney = payWorkingGroupSubItemService.queryPageList233(payWorkingGroupSubletSearch,id); AllMoney allMoney = payWorkingGroupSubItemService.queryPageList233(payWorkingGroupSubletSearch, id);
// double sum=0;
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0.0" : t.getAllMoney())).sum();
// sumTwo = pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0.0" : t.getComeAllMoney())).sum();
// }
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
DecimalFormat df = new DecimalFormat("#,##0.00"); DecimalFormat df = new DecimalFormat("#,##0.00");
// 转义来款用途 // 转义来款用途
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){ for (PayWorkGroupSubletStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
} }
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){ for (PayWorkGroupSubletStatistics s : pageList.getRecords()) {
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){ if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.0"); s.setAllMoney("0.0");
} }
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.0"); s.setComeAllMoney("0.0");
} }
} }
hashMap.put("pageList",pageList); hashMap.put("pageList", pageList);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
return Result.OK(hashMap); return Result.OK(hashMap);
} }
/** /**
*导出 * 导出
* @param id
* *
* @param id
*/ */
@AutoLog(value = "工作组成员统计-导出统计(传工作组id)") @AutoLog(value = "工作组成员统计-导出统计(传工作组id)")
@GetMapping(value = "/excelSub") @GetMapping(value = "/excelSub")
@@ -281,7 +194,7 @@ public class PayWorkingGroupStatisticsController {
public ModelAndView excelSub( public ModelAndView excelSub(
PayWorkingGroupSubletSearch payWorkingGroupSubletSearch, PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,
@RequestParam(name = "id", required = true) String id, @RequestParam(name = "id", required = true) String id,
@RequestParam(name = "selections", required = false) String selections){ @RequestParam(name = "selections", required = false) String selections) {
if (ObjectUtils.isEmpty(selections)) { if (ObjectUtils.isEmpty(selections)) {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName())); payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics(payWorkingGroupSubletSearch, id); List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics(payWorkingGroupSubletSearch, id);
@@ -295,10 +208,10 @@ public class PayWorkingGroupStatisticsController {
} }
} }
return AmountUtil.exportListXls(pageList, PayWorkGroupSubletStatistics.class, "工作组成员统计"); return AmountUtil.exportListXls(pageList, PayWorkGroupSubletStatistics.class, "工作组成员统计");
}else{ } else {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName())); payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
ArrayList<String> selections2 = new ArrayList<>(Arrays.asList(selections.split(","))); ArrayList<String> selections2 = new ArrayList<>(Arrays.asList(selections.split(",")));
List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics2(payWorkingGroupSubletSearch,id,selections2); List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics2(payWorkingGroupSubletSearch, id, selections2);
//处理为空数据为0 //处理为空数据为0
for (PayWorkGroupSubletStatistics s : pageList) { for (PayWorkGroupSubletStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
* @author zql * @author zql
* @date 2021/9/20 21:00:00 * @date 2021/9/20 21:00:00
*/ */
@Api(tags="个人来款统计") @Api(tags = "个人来款统计")
@RestController @RestController
@RequestMapping("/statistics/principalPeople") @RequestMapping("/statistics/principalPeople")
@Slf4j @Slf4j
@@ -72,16 +72,16 @@ public class PrincipalPeopleStatisticsController {
//根据不同角色加载不同列表的参数 //根据不同角色加载不同列表的参数
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
//判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码 //判断登录角色,显示特定内容,判断依据为登录用户的角色和机构编码
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String roleCode = sysUser.getRoleCode(); String roleCode = sysUser.getRoleCode();
List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(","))); List<String> roleCodes = new ArrayList<>(Arrays.asList(roleCode.split(",")));
//admin //admin
if (roleCodes.contains(constant.ADMIN)) { if (roleCodes.contains(constant.ADMIN)) {
idList = null; idList = null;
//部门负责人 //部门负责人
} else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) { } else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员) //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList); List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
//获取本部门成员 //获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList())); idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -94,8 +94,8 @@ public class PrincipalPeopleStatisticsController {
return Result.OK(); return Result.OK();
} }
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize); Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page,principalPeopleSearch,idList); IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page, principalPeopleSearch, idList);
AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipal33(principalPeopleSearch,idList); AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipal33(principalPeopleSearch, idList);
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
// double sum=0; // double sum=0;
@@ -105,21 +105,21 @@ public class PrincipalPeopleStatisticsController {
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0; // sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// } // }
//处理为空数据为0 //处理为空数据为0
for(PrincipalPeopleList s: pageList.getRecords()) { for (PrincipalPeopleList s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
if(s.getFinishRate() == null || s.getFinishRate().equals("")){ if (s.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%"); s.setFinishRate("0.00%");
} }
} }
DecimalFormat df = new DecimalFormat("#,##0.00"); DecimalFormat df = new DecimalFormat("#,##0.00");
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList",pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
@@ -141,20 +141,13 @@ public class PrincipalPeopleStatisticsController {
IPage<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetail(page, principalPeopleDetailSearch); IPage<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetail(page, principalPeopleDetailSearch);
AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipalDetail33(principalPeopleDetailSearch); AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipalDetail33(principalPeopleDetailSearch);
HashMap<String, Object> hashMap = new HashMap<>(); HashMap<String, Object> hashMap = new HashMap<>();
// double sum=0; for (PrincipalPeopleDetail s : pageList.getRecords()) {
// double sumTwo =0;
// if(ObjectUtils.isNotEmpty(pageList.getRecords())) {
// sum = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getAllMoney() == null || t.getAllMoney().equals("") ? "0" : t.getAllMoney())).sum() : 0;
// sumTwo = pageList.getRecords() != null ? pageList.getRecords().stream().mapToDouble(t -> Double.parseDouble(t.getComeAllMoney() == null || t.getComeAllMoney().equals("") ? "0" : t.getComeAllMoney())).sum() : 0;
// }
// DecimalFormat df = new DecimalFormat("#,##0.00");
for(PrincipalPeopleDetail s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse()); String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key); String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use); s.setChargeUse_text(payment_charge_use);
} }
//处理为空数据为0 //处理为空数据为0
for(PrincipalPeopleDetail s: pageList.getRecords()) { for (PrincipalPeopleDetail s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
@@ -163,22 +156,21 @@ public class PrincipalPeopleStatisticsController {
} }
} }
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney()); hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney()); hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList); hashMap.put("pageList", pageList);
return Result.OK(hashMap); return Result.OK(hashMap);
} }
/** /**
*个人来款统计导出 * 个人来款统计导出
*
*/ */
@RequiresPermissions("individualPaymentStatistics:export") @RequiresPermissions("individualPaymentStatistics:export")
@AutoLog(value = "个人来款统计导出-导出统计") @AutoLog(value = "个人来款统计导出-导出统计")
@GetMapping(value = "/excel") @GetMapping(value = "/excel")
@ApiOperation(value = "个人来款统计导出-导出统计", notes = "个人来款统计导出-导出统计") @ApiOperation(value = "个人来款统计导出-导出统计", notes = "个人来款统计导出-导出统计")
public ModelAndView excel( PrincipalPeopleSearch principalPeopleSearch) { public ModelAndView excel(PrincipalPeopleSearch principalPeopleSearch) {
if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) { if (principalPeopleSearch.getYear() == null || principalPeopleSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR)); String year = String.valueOf(calendar.get(Calendar.YEAR));
@@ -194,9 +186,9 @@ public class PrincipalPeopleStatisticsController {
if (roleCodes.contains(constant.ADMIN)) { if (roleCodes.contains(constant.ADMIN)) {
idList = null; idList = null;
//部门负责人 //部门负责人
} else if (roleCodes.contains(constant.BMFZR)||roleCodes.contains(constant.SLD)) { } else if (roleCodes.contains(constant.BMFZR) || roleCodes.contains(constant.SLD)) {
//获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员) //获取本部门及其所有下部部门所有成员(不包含最开始的部门下级成员)
List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(),idList); List<String> allDepartIds = sysBaseAPI.getAllDepartIds(sysUser.getDepartIds(), idList);
//获取本部门成员 //获取本部门成员
idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList())); idList.addAll((userMapper.selectList(new QueryWrapper<SysUser>().eq("status", 1).eq("del_flag", 0).eq("org_code", sysUser.getOrgCode()))).stream().map(SysUser::getId).collect(Collectors.toList()));
@@ -211,14 +203,14 @@ public class PrincipalPeopleStatisticsController {
} }
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList); List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
//处理为空数据为0 //处理为空数据为0
for(PrincipalPeopleList s: pageList) { for (PrincipalPeopleList s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) { if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00"); s.setAllMoney("0.00");
} }
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) { if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00"); s.setComeAllMoney("0.00");
} }
if(s.getFinishRate() == null || s.getFinishRate().equals("")){ if (s.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%"); s.setFinishRate("0.00%");
} }
@@ -228,13 +220,12 @@ public class PrincipalPeopleStatisticsController {
} }
/** /**
*个人来款统详情计导出 * 个人来款统详情计导出
*
*/ */
@AutoLog(value = "个人来款统详情计导出-导出统计") @AutoLog(value = "个人来款统详情计导出-导出统计")
@GetMapping(value = "/excelDetail") @GetMapping(value = "/excelDetail")
@ApiOperation(value = "个人来款统详情计导出-导出统计", notes = "个人来款统详情计导出-导出统计") @ApiOperation(value = "个人来款统详情计导出-导出统计", notes = "个人来款统详情计导出-导出统计")
public ModelAndView excelDetail( PrincipalPeopleDetailSearch principalPeopleDetailSearch) { public ModelAndView excelDetail(PrincipalPeopleDetailSearch principalPeopleDetailSearch) {
if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) { if (principalPeopleDetailSearch.getYear() == null || principalPeopleDetailSearch.getYear().equals("")) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR)); String year = String.valueOf(calendar.get(Calendar.YEAR));
@@ -10,4 +10,6 @@ public class AllMoney {
private String allMoney; private String allMoney;
private String comeAllMoney; private String comeAllMoney;
private String billMoney;
} }
@@ -30,6 +30,10 @@ public class AllProjectStatistics {
@ApiModelProperty(value = "实收总金额") @ApiModelProperty(value = "实收总金额")
private String comeAllMoney; private String comeAllMoney;
@Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额")
private String billMoney;
@ApiModelProperty(value = "来款用途编码") @ApiModelProperty(value = "来款用途编码")
private String chargeUse; private String chargeUse;
@@ -45,5 +45,12 @@ public class AllProjectStatisticsSearch {
@ApiModelProperty(value = "部门编码") @ApiModelProperty(value = "部门编码")
private String departCode; private String departCode;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
} }
@@ -37,4 +37,13 @@ public class CompanyComeMoneyDetailSearch {
@ApiModelProperty(value = "应收总金额范围") @ApiModelProperty(value = "应收总金额范围")
private String allMoneyTwo; private String allMoneyTwo;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
} }
@@ -29,4 +29,13 @@ public class CompanyComeMoneySearch {
@ApiModelProperty(value = "应收总金额范围") @ApiModelProperty(value = "应收总金额范围")
private String allMoneyTwo; private String allMoneyTwo;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
} }
@@ -38,4 +38,13 @@ public class PrincipalPeopleDetailSearch {
@ApiModelProperty(value = "应收总金额范围") @ApiModelProperty(value = "应收总金额范围")
private String allMoneyTwo; private String allMoneyTwo;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
} }
@@ -25,4 +25,13 @@ public class PrincipalPeopleSearch {
@ApiModelProperty(value = "部门编码") @ApiModelProperty(value = "部门编码")
private String departCode; private String departCode;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
} }