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
+43 -13
View File
@@ -14,11 +14,12 @@ select pp.id as projectId,
year,
payStatue,
departCode,
confirmAmount,
principalNameId,
type,
pp.pack
from (SELECT pwgs.id,
pwg.id as superId,
pwg.id as superId,
pwg.working_group_project AS projectName,
pwg.principal_name_a as principalName,
pwgs.charge_company_temporary_id as chargeCompanyTemporaryId,
@@ -31,16 +32,18 @@ from (SELECT pwgs.id,
pwg.year as year,
pwgs.in_account as payStatue,
su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pwg.principal_id_a as principalNameId,
2 as type,
2 as type,
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 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_depart sd on (su.org_code = sd.org_code)
union all
SELECT pcp.id,
pcp.id as superId,
pcp.id as superId,
pcp.charge_project AS projectName,
pcp.principal_name as principalName,
pcp.charge_company_temporary_id as chargeCompanyTemporaryId,
@@ -53,15 +56,17 @@ from (SELECT pwgs.id,
pcp.year as year,
pcp.in_account as payStatue,
su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pcp.principal_id as principalNameId,
1 as type,
1 as type,
pcp.create_time as createTime
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_depart sd on (su.org_code = sd.org_code)
union all
SELECT pmps.id,
pmp.id as superId,
pmp.id as superId,
pmp.project_name AS projectName,
su.realname as principalName,
pmps.company_id as chargeCompanyTemporaryId,
@@ -74,16 +79,18 @@ from (SELECT pwgs.id,
pmp.particular_year as year,
pmps.in_account as payStatue,
su.org_code as departCode,
pcpr.amount_received as confirmAmount,
pmp.director_id as principalNameId,
4 as type,
4 as type,
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 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_depart sd on (su.org_code = sd.org_code)
union all
SELECT pms.id,
pm.id as superId,
pm.id as superId,
pm.meeting_name AS projectName,
su.realname as principalName,
pms.company_id as chargeCompanyTemporaryId,
@@ -96,8 +103,9 @@ from (SELECT pwgs.id,
pm.particular_year as year,
pms.in_account as payStatue,
su.org_code as departCode,
0 as confirmAmount,
pm.director_id as principalNameId,
3 as type,
3 as type,
pms.create_time as createTime
FROM pay_meeting pm
right join pay_meeting_situation pms on (pm.id = pms.meeting_id)
@@ -105,7 +113,7 @@ from (SELECT pwgs.id,
left join sys_depart sd on (su.org_code = sd.org_code)
union all
SELECT tmps.id,
tmp.id as superId,
tmp.id as superId,
tmp.project_name AS projectName,
su.realname as principalName,
tmps.company_id as chargeCompanyTemporaryId,
@@ -118,8 +126,9 @@ from (SELECT pwgs.id,
tmp.year as year,
tmps.in_account as payStatue,
su.org_code as departCode,
0 as confirmAmount,
tmp.director_id as principalNameId,
5 as type,
5 as type,
tmps.create_time as createTime
FROM tb_member_project tmp
left join tb_member_project_subitem tmps on (tmp.id = tmps.project_id)
@@ -127,7 +136,7 @@ from (SELECT pwgs.id,
left join sys_depart sd on (su.org_code = sd.org_code)
union all
SELECT tcp.id,
tmp.id as superId,
tmp.id as superId,
tmp.project_name AS projectName,
su.realname as principalName,
tcp.company_id as chargeCompanyTemporaryId,
@@ -140,8 +149,9 @@ from (SELECT pwgs.id,
tmp.year as year,
tcp.in_account as payStatue,
su.org_code as departCode,
0 as confirmAmount,
tmp.director_id as principalNameId,
6 as type,
6 as type,
tcp.create_time as createTime
FROM tb_member_project tmp
left join tb_certificate_payment tcp on (tmp.id = tcp.project_id)
@@ -150,4 +160,24 @@ from (SELECT pwgs.id,
) pp
where pp.allMoney is not null
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
from
v_statistical
<where>
type = 2
<if test="ids != null and ids != ''">
@@ -301,8 +302,22 @@
<!-- 全所统计-->
<select id="queryPageList3" resultType="com.jero.statistics.entity.AllProjectStatistics">
select projectId,projectName, principalName, chargeCompanyTemporaryName, allMoney, comeAllMoney, chargeUse, depart, createTime, packText,pack
from v_statistical
select * from
(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>
<if test="idList != null and idList != ''">
principalNameId in
@@ -353,12 +368,38 @@
</if>
</otherwise>
</choose>
<if test="allProjectStatisticsSearch.billYear != null and allProjectStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{allProjectStatisticsSearch.billYear}, '%')
</if>
</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 id="queryPageList33" resultType="com.jero.statistics.entity.AllMoney">
select sum(allMoney) as allMoney, sum(comeAllMoney) as comeAllMoney from
v_statistical
select sum(allMoney) as allMoney,
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>
<if test="idList != null and idList != ''">
principalNameId in
@@ -366,38 +407,40 @@
#{item}
</foreach>
</if>
<if test="allProjectStatisticsSearch.projectName != null and allProjectStatisticsSearch.projectName != ''">
AND projectName LIKE
concat('%',#{allProjectStatisticsSearch.projectName},'%')
concat('%', #{allProjectStatisticsSearch.projectName}, '%')
</if>
<if test="allProjectStatisticsSearch.year != null and allProjectStatisticsSearch.year != ''">
AND year LIKE
concat(#{allProjectStatisticsSearch.year},'%')
concat(#{allProjectStatisticsSearch.year}, '%')
</if>
<if test="allProjectStatisticsSearch.payStatue != null and allProjectStatisticsSearch.payStatue != ''">
AND payStatue LIKE
concat('%',#{allProjectStatisticsSearch.payStatue},'%')
concat('%', #{allProjectStatisticsSearch.payStatue}, '%')
</if>
<if test="allProjectStatisticsSearch.departCode != null and allProjectStatisticsSearch.departCode != ''">
AND departCode =#{allProjectStatisticsSearch.departCode}
AND departCode = #{allProjectStatisticsSearch.departCode}
</if>
<if test="allProjectStatisticsSearch.chargeUse != null and allProjectStatisticsSearch.chargeUse != ''">
AND chargeUse=#{allProjectStatisticsSearch.chargeUse}
AND chargeUse = #{allProjectStatisticsSearch.chargeUse}
</if>
<if test="allProjectStatisticsSearch.chargeCompanyTemporaryName != null and allProjectStatisticsSearch.chargeCompanyTemporaryName != ''">
AND chargeCompanyTemporaryName LIKE
concat('%',#{allProjectStatisticsSearch.chargeCompanyTemporaryName},'%')
concat('%', #{allProjectStatisticsSearch.chargeCompanyTemporaryName}, '%')
</if>
<if test="allProjectStatisticsSearch.principalNameId != null and allProjectStatisticsSearch.principalNameId != ''">
AND principalNameId=#{allProjectStatisticsSearch.principalNameId}
AND principalNameId = #{allProjectStatisticsSearch.principalNameId}
</if>
<if test="allProjectStatisticsSearch.pack != null and allProjectStatisticsSearch.pack != ''">
AND pack=#{allProjectStatisticsSearch.pack}
AND pack = #{allProjectStatisticsSearch.pack}
</if>
<choose>
<when test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != '' and allProjectStatisticsSearch.allMoneyTwo != null and allProjectStatisticsSearch.allMoneyTwo != ''">
AND allMoney >= #{allProjectStatisticsSearch.allMoney} and allMoney <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
AND allMoney >= #{allProjectStatisticsSearch.allMoney}
and allMoney <![CDATA[<]]>=
#{allProjectStatisticsSearch.allMoneyTwo}
</when>
<otherwise>
<if test="allProjectStatisticsSearch.allMoney != null and allProjectStatisticsSearch.allMoney != ''">
@@ -408,6 +451,9 @@
</if>
</otherwise>
</choose>
<if test="allProjectStatisticsSearch.billYear != null and allProjectStatisticsSearch.billYear != ''">
and DATE_FORMAT (pmb.bill_date,'%Y') like concat(#{allProjectStatisticsSearch.billYear}, '%')
</if>
</where>
</select>
<!-- 全所统计导出-->
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
* @author zql
* @date 2021/9/17 16:29
*/
@Api(tags="全所统计")
@Api(tags = "全所统计")
@RestController
@RequestMapping("/statistics/allProjectStatistics")
@Slf4j
@@ -64,69 +64,39 @@ public class AllProjectStatisticsController {
@RequiresPermissions("wholeInstituteStatistics:search")
@ApiOperation(value = "全所统计搜索-分页列表查询", notes = "全所统计搜索-详情分页列表查询")
@GetMapping(value = "/list")
public Result<?> list( AllProjectStatisticsSearch allProjectStatisticsSearch,
public Result<?> list(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
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(",")));
// //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);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page,allProjectStatisticsSearch, null );
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) {
for(AllProjectStatistics s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
}
//处理为空数据为0
for(AllProjectStatistics s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
allProjectStatisticsSearch.setProjectName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getProjectName()));
allProjectStatisticsSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(allProjectStatisticsSearch.getChargeCompanyTemporaryName()));
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageList(page, allProjectStatisticsSearch, null);
HashMap<String, Object> hashMap = new HashMap<>();
DecimalFormat df = new DecimalFormat("#,##0.00");
if (pageList.getRecords() != null) {
for (AllProjectStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
}
//处理为空数据为0
for (AllProjectStatistics s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch,null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
}
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, null);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
@@ -142,251 +112,187 @@ public class AllProjectStatisticsController {
@ApiOperation(value = "科室来款统计-分页列表查询", notes = "科室来款统计-详情分页列表查询")
@GetMapping(value = "/listProject")
public Result<?> listProject(AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
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(",")));
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
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(",")));
//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()));
//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 {
return Result.OK();
idList.addAll(allDepartIds);//项目负责人
} else {
return Result.OK();
}
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page, allProjectStatisticsSearch, idList);
HashMap<String, Object> hashMap = new HashMap<>();
if (pageList.getRecords() != null) {
for (AllProjectStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
Page<AllProjectStatistics> page = new Page<>(pageNo, pageSize);
IPage<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListForProject(page,allProjectStatisticsSearch,idList);
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) {
for(AllProjectStatistics s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
}
//处理为空数据为0
for (AllProjectStatistics s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
//处理为空数据为0
for(AllProjectStatistics s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch,idList);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
}
AllMoney allMoney = payWorkingGroupService.queryPageList33(allProjectStatisticsSearch, idList);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
/**
*所领导统计导出
*
* 所领导统计导出
*/
@RequiresPermissions("wholeInstituteStatistics:export")
@AutoLog(value = "全所统计导出-导出统计")
@GetMapping(value = "/statistics/excel")
@ApiOperation(value = "全所统计导出-导出统计", notes = "全所统计导出-导出统计")
public ModelAndView excel( AllProjectStatisticsSearch allProjectStatisticsSearch,
@RequestParam(name = "selections",required = false) String selections) {
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(",")));
//
// //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("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, null);
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);
//处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
}
}
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();
// 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("")) {
Calendar calendar = Calendar.getInstance();
String year = String.valueOf(calendar.get(Calendar.YEAR));
allProjectStatisticsSearch.setYear(year);
}
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, null,strings);
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);
//处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
}
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
}
}
/**
*企业来款统计
*
*/
@RequiresPermissions("projectPaymentStatistics:export")
@AutoLog(value = "项目来款统计-导出统计")
@GetMapping(value = "/statistics/excelProject")
@ApiOperation(value = "项目来款统计-导出统计", notes = "项目来款统计-导出统计")
public ModelAndView excelProject( AllProjectStatisticsSearch allProjectStatisticsSearch) {
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(",")));
//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 {
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "项目来款统计");
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);
List<AllProjectStatistics> pageList = payWorkingGroupService.queryPageListExcel(allProjectStatisticsSearch, null);
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);
//处理为空数据为0
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
}
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()));
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, null, strings);
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);
//处理为空数据为0
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "项目来款统计");
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "所领导统计");
}
}
/**
* 企业来款统计
*/
@RequiresPermissions("projectPaymentStatistics:export")
@AutoLog(value = "项目来款统计-导出统计")
@GetMapping(value = "/statistics/excelProject")
@ApiOperation(value = "项目来款统计-导出统计", notes = "项目来款统计-导出统计")
public ModelAndView excelProject(AllProjectStatisticsSearch allProjectStatisticsSearch) {
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(",")));
//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 {
ArrayList<AllProjectStatistics> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, AllProjectStatistics.class, "项目来款统计");
}
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);
//处理为空数据为0
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
}
return AmountUtil.exportListXls(pageList, AllProjectStatistics.class, "项目来款统计");
}
@ApiOperation(value = "通过部门id查所有人员", notes = "通过部门id查所有人员")
@RequestMapping(value = "/listForUserByOrgCode", method = RequestMethod.GET)
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());
public Result<?> listForUserByOrgCode(@RequestParam(name = "departCode", required = true) String departCode) {
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code",departCode);
queryWrapper.eq("del_flag",0);
queryWrapper.eq("status",1);
queryWrapper.eq("org_code", departCode);
queryWrapper.eq("del_flag", 0);
queryWrapper.eq("status", 1);
List<SysUser> pageList = sysUserService.list(queryWrapper);
return Result.OK(pageList);
return Result.OK(pageList);
}
}
@@ -32,7 +32,7 @@ import java.util.*;
* @author zql
* @date 2021/9/23 14:07
*/
@Api(tags="企业来款统计")
@Api(tags = "企业来款统计")
@RestController
@RequestMapping("/statistics/companyComeMoney")
@Slf4j
@@ -50,8 +50,8 @@ public class CompanyComeMoneyStatisticsController {
* 分页列表查询
*
* @param companyComeMoneySearch 企业来款统计
* @param pageNo 页数
* @param pageSize 条数
* @param pageNo 页数
* @param pageSize 条数
*/
@RequiresPermissions("companyPaymentStatistics:search")
@ApiOperation(value = "企业来款统计-分页列表查询", notes = "企业来款统计-分页列表查询")
@@ -59,29 +59,29 @@ public class CompanyComeMoneyStatisticsController {
public Result<?> list(CompanyComeMoneySearch companyComeMoneySearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page,companyComeMoneySearch,null);
HashMap<String, Object> hashMap = new HashMap<>();
//处理为空数据为0
for(CompanyComeMoneyList s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.00");
}
if(s.getFinishRate()== null || s.getFinishRate().equals("") ) {
s.setFinishRate("0.00%");
}
Page<CompanyComeMoneyList> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompany(page, companyComeMoneySearch, null);
HashMap<String, Object> hashMap = new HashMap<>();
//处理为空数据为0
for (CompanyComeMoneyList s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if (s.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%");
}
DecimalFormat df = new DecimalFormat("#,##0.00");
AllMoney allMoney = payWorkingGroupService.queryPageListForCompany33(companyComeMoneySearch,null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
}
DecimalFormat df = new DecimalFormat("#,##0.00");
AllMoney allMoney = payWorkingGroupService.queryPageListForCompany33(companyComeMoneySearch, null);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
@@ -90,8 +90,8 @@ public class CompanyComeMoneyStatisticsController {
* 分页列表查询
*
* @param companyComeMoneyDetailSearch 企业来款统计
* @param pageNo 页数
* @param pageSize 条数
* @param pageNo 页数
* @param pageSize 条数
*/
@RequiresPermissions("companyPaymentStatistics:detail")
@ApiOperation(value = "企业来款详情统计-详情分页列表查询", notes = "企业来款详情统计-详情分页列表查询")
@@ -99,93 +99,91 @@ public class CompanyComeMoneyStatisticsController {
public Result<?> listForDetail(CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
companyComeMoneyDetailSearch.setProjectName( oConvertUtils.replaceAllPercent(companyComeMoneyDetailSearch.getProjectName()));
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
if(ObjectUtils.isEmpty(byId)){
return Result.error("企业id错误,无对应企业id");
}
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch,null);
for(CompanyComeMoneyDetail s: pageList.getRecords()){
s.setChargeCompanyName(byId.getCompanyName());
}
HashMap<String, Object> hashMap = new HashMap<>();
for(CompanyComeMoneyDetail s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
//处理为空数据为0
for(CompanyComeMoneyDetail s: pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
AllMoney allMoney = payWorkingGroupService.queryPageListForCompanyDetail33(companyComeMoneyDetailSearch,null);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
companyComeMoneyDetailSearch.setProjectName(oConvertUtils.replaceAllPercent(companyComeMoneyDetailSearch.getProjectName()));
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
if (ObjectUtils.isEmpty(byId)) {
return Result.error("企业id错误,无对应企业id");
}
Page<CompanyComeMoneyDetail> page = new Page<>(pageNo, pageSize);
IPage<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetail(page, companyComeMoneyDetailSearch, null);
for (CompanyComeMoneyDetail s : pageList.getRecords()) {
s.setChargeCompanyName(byId.getCompanyName());
}
HashMap<String, Object> hashMap = new HashMap<>();
for (CompanyComeMoneyDetail s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
//处理为空数据为0
for (CompanyComeMoneyDetail s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
AllMoney allMoney = payWorkingGroupService.queryPageListForCompanyDetail33(companyComeMoneyDetailSearch, null);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
/**
*企业来款统计
*
* 企业来款统计
*/
@RequiresPermissions("companyPaymentStatistics:export")
@AutoLog(value = "企业来款统计-导出统计")
@GetMapping(value = "/excel")
@ApiOperation(value = "企业来款统计-导出统计", notes = "企业来款统计-导出统计")
public ModelAndView excel(CompanyComeMoneySearch companyComeMoneySearch) {
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, null);
//处理为空数据为0
for(CompanyComeMoneyList 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.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyList.class, "企业来款统计");
List<CompanyComeMoneyList> pageList = payWorkingGroupService.queryPageListForCompanyExcel(companyComeMoneySearch, null);
//处理为空数据为0
for (CompanyComeMoneyList 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.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyList.class, "企业来款统计");
}
/**
*企业来款统计
*
* 企业来款统计
*/
@AutoLog(value = "企业来款详情统计-导出统计")
@GetMapping(value = "/excelDetail")
@ApiOperation(value = "企业来款详情统计-导出统计", notes = "企业来款详情统计-导出统计")
public ModelAndView excelDetail( CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) {
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, null);
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
for(CompanyComeMoneyDetail s:pageList){
s.setChargeCompanyName(byId.getCompanyName());
public ModelAndView excelDetail(CompanyComeMoneyDetailSearch companyComeMoneyDetailSearch) {
List<CompanyComeMoneyDetail> pageList = payWorkingGroupService.queryPageListForCompanyDetailExcel(companyComeMoneyDetailSearch, null);
PayCompanyManagement byId = payCompanyManagementService.getById(companyComeMoneyDetailSearch.getChargeCompanyId());
for (CompanyComeMoneyDetail s : pageList) {
s.setChargeCompanyName(byId.getCompanyName());
}
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);
//处理为空数据为0
for (CompanyComeMoneyDetail ss : pageList) {
if (ss.getAllMoney() == null || ss.getAllMoney().equals("")) {
ss.setAllMoney("0.00");
}
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);
//处理为空数据为0
for(CompanyComeMoneyDetail ss: pageList) {
if (ss.getAllMoney() == null || ss.getAllMoney().equals("")) {
ss.setAllMoney("0.00");
}
if (ss.getComeAllMoney() == null || ss.getComeAllMoney().equals("")) {
ss.setComeAllMoney("0.00");
}
}
if (ss.getComeAllMoney() == null || ss.getComeAllMoney().equals("")) {
ss.setComeAllMoney("0.00");
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyDetail.class, "企业来款详情统计");
}
}
return AmountUtil.exportListXls(pageList, CompanyComeMoneyDetail.class, "企业来款详情统计");
}
@@ -34,7 +34,7 @@ import java.util.*;
* @author zql
* @date 2021/9/15 8:54
*/
@Api(tags="工作组统计")
@Api(tags = "工作组统计")
@RestController
@RequestMapping("/project/payWorkingGroupStatistics")
@Slf4j
@@ -52,181 +52,100 @@ public class PayWorkingGroupStatisticsController {
* 工作组项目统计-统计分页列表查询
*
* @param payWorkingGroupSearch 工作组项目
* @param pageNo 页数
* @param pageSize 条数
*
* @param pageNo 页数
* @param pageSize 条数
*/
@RequiresPermissions("workingGroupPaymentStatistics:search")
@ApiOperation(value="工作组项目统计-统计分页列表查询", notes="工作组项目统计-统计分页列表查询")
@ApiOperation(value = "工作组项目统计-统计分页列表查询", notes = "工作组项目统计-统计分页列表查询")
@GetMapping(value = "/list")
public Result<?> list(PayWorkingGroupSearch payWorkingGroupSearch,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
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();
for (PayWorkingGroupStatistics payWorkingGroupStatistics:records){
if(payWorkingGroupStatistics.getComeAllMoney()==null|| payWorkingGroupStatistics.getComeAllMoney().equals("")){
for (PayWorkingGroupStatistics payWorkingGroupStatistics : records) {
if (payWorkingGroupStatistics.getComeAllMoney() == null || payWorkingGroupStatistics.getComeAllMoney().equals("")) {
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
for(PayWorkingGroupStatistics s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
for (PayWorkingGroupStatistics s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ){
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if(s.getMoneyRate()== null || s.getMoneyRate().equals("") ) {
if (s.getMoneyRate() == null || s.getMoneyRate().equals("")) {
s.setMoneyRate("0.00%");
}
}
HashMap<String, Object> hashMap = new HashMap<>();
hashMap.put("pageList",pageList.setRecords(records));
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList", pageList.setRecords(records));
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
return Result.OK(hashMap);
}
/**
* 工作组项目统计-统计导出excel
*
*/
@RequiresPermissions("workingGroupPaymentStatistics:export")
@AutoLog(value = "工作组项目统计-统计导出excel")
@GetMapping(value = "/exportXls2")
@ApiOperation(value="工作组项目统计-统计导出excel", notes="工作组项目统计-统计导出excel")
public ModelAndView exportXls2( PayWorkingGroupSearch payWorkingGroupSearch, @RequestParam(name = "selections", required = false) String selections) {
@ApiOperation(value = "工作组项目统计-统计导出excel", notes = "工作组项目统计-统计导出excel")
public ModelAndView exportXls2(PayWorkingGroupSearch payWorkingGroupSearch, @RequestParam(name = "selections", required = false) String selections) {
if (StringUtils.isBlank(selections)) {
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);
//处理为空数据为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 {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
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, "工作组项目统计");
// }
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch,null,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%");
}
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, null);
//处理为空数据为0
for (PayWorkingGroupStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
return AmountUtil.exportListXls(pageList, PayWorkingGroupStatistics.class, "工作组项目统计");
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 {
ArrayList<String> strings = new ArrayList<>(Arrays.asList(selections.split(",")));
payWorkingGroupSearch.setWorkGroup(oConvertUtils.replaceAllPercent(payWorkingGroupSearch.getWorkGroup()));
List<PayWorkingGroupStatistics> pageList = payWorkingGroupService.queryPageListForStatisticsExcel(payWorkingGroupSearch, null, 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, "工作组项目统计");
}
}
/**
* 工作组成员统计-详情分页列表查询(传工作组id)
*
* @param payWorkingGroupSubletSearch 工作组成员统计搜索
* @param pageNo 页数
* @param pageSize 条数
*
*/
@RequiresPermissions("workingGroupPaymentStatistics:detail")
@ApiOperation(value = "工作组成员统计-详情分页列表查询(传工作组id)", notes = "工作组成员统计-详情分页列表查询(传工作组id)")
@@ -236,43 +155,37 @@ public class PayWorkingGroupStatisticsController {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "id") String id,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize);
IPage<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.queryPageList2(page, payWorkingGroupSubletSearch,id);
AllMoney allMoney = payWorkingGroupSubItemService.queryPageList233(payWorkingGroupSubletSearch,id);
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
Page<PayWorkGroupSubletStatistics> page = new Page<>(pageNo, pageSize);
IPage<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.queryPageList2(page, 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<>();
DecimalFormat df = new DecimalFormat("#,##0.00");
// 转义来款用途
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
HashMap<String, Object> hashMap = new HashMap<>();
DecimalFormat df = new DecimalFormat("#,##0.00");
// 转义来款用途
for (PayWorkGroupSubletStatistics s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
for (PayWorkGroupSubletStatistics s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.0");
}
for(PayWorkGroupSubletStatistics s: pageList.getRecords()){
if(s.getAllMoney()== null || s.getAllMoney().equals("") ){
s.setAllMoney("0.0");
}
if(s.getComeAllMoney()== null || s.getComeAllMoney().equals("") ) {
s.setComeAllMoney("0.0");
}
}
hashMap.put("pageList",pageList);
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
return Result.OK(hashMap);
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.0");
}
}
hashMap.put("pageList", pageList);
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
return Result.OK(hashMap);
}
/**
*导出
* @param id
* 导出
*
* @param id
*/
@AutoLog(value = "工作组成员统计-导出统计(传工作组id)")
@GetMapping(value = "/excelSub")
@@ -281,7 +194,7 @@ public class PayWorkingGroupStatisticsController {
public ModelAndView excelSub(
PayWorkingGroupSubletSearch payWorkingGroupSubletSearch,
@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)) {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
List<PayWorkGroupSubletStatistics> pageList = payWorkingGroupSubItemService.importExcelStatistics(payWorkingGroupSubletSearch, id);
@@ -295,10 +208,10 @@ public class PayWorkingGroupStatisticsController {
}
}
return AmountUtil.exportListXls(pageList, PayWorkGroupSubletStatistics.class, "工作组成员统计");
}else{
} else {
payWorkingGroupSubletSearch.setChargeCompanyTemporaryName(oConvertUtils.replaceAllPercent(payWorkingGroupSubletSearch.getChargeCompanyTemporaryName()));
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
for (PayWorkGroupSubletStatistics s : pageList) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
@@ -44,7 +44,7 @@ import java.util.stream.Collectors;
* @author zql
* @date 2021/9/20 21:00:00
*/
@Api(tags="个人来款统计")
@Api(tags = "个人来款统计")
@RestController
@RequestMapping("/statistics/principalPeople")
@Slf4j
@@ -60,8 +60,8 @@ public class PrincipalPeopleStatisticsController {
* 分页列表查询
*
* @param principalPeopleSearch 全统计搜索
* @param pageNo 页数
* @param pageSize 条数
* @param pageNo 页数
* @param pageSize 条数
*/
@RequiresPermissions("individualPaymentStatistics:search")
@ApiOperation(value = "个人来款统计-分页列表查询", notes = "个人来款统计-分页列表查询")
@@ -69,33 +69,33 @@ public class PrincipalPeopleStatisticsController {
public Result<?> list(PrincipalPeopleSearch principalPeopleSearch,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer 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()));
//根据不同角色加载不同列表的参数
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();
}
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page,principalPeopleSearch,idList);
AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipal33(principalPeopleSearch,idList);
idList.addAll(allDepartIds);
//项目负责人
} else if (roleCodes.contains(constant.XMFZR)) {
String userId = sysUser.getId();
idList.add(userId);
} else {
return Result.OK();
}
Page<PrincipalPeopleList> page = new Page<>(pageNo, pageSize);
IPage<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipal(page, principalPeopleSearch, idList);
AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipal33(principalPeopleSearch, idList);
HashMap<String, Object> hashMap = new HashMap<>();
// double sum=0;
@@ -104,23 +104,23 @@ public class PrincipalPeopleStatisticsController {
// 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;
// }
//处理为空数据为0
for(PrincipalPeopleList s: pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if(s.getFinishRate() == null || s.getFinishRate().equals("")){
s.setFinishRate("0.00%");
}
//处理为空数据为0
for (PrincipalPeopleList s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
DecimalFormat df = new DecimalFormat("#,##0.00");
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList",pageList);
return Result.OK(hashMap);
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if (s.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%");
}
}
DecimalFormat df = new DecimalFormat("#,##0.00");
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
@@ -129,8 +129,8 @@ public class PrincipalPeopleStatisticsController {
* 分页列表查询
*
* @param principalPeopleDetailSearch 详情全统计搜索
* @param pageNo 页数
* @param pageSize 条数
* @param pageNo 页数
* @param pageSize 条数
*/
@ApiOperation(value = "个人来款统计-详情分页列表查询", notes = "个人来款统计-详情分页列表查询")
@GetMapping(value = "/listForDetail")
@@ -141,118 +141,109 @@ public class PrincipalPeopleStatisticsController {
IPage<PrincipalPeopleDetail> pageList = payWorkingGroupService.queryPageListForPrincipalDetail(page, principalPeopleDetailSearch);
AllMoney allMoney = payWorkingGroupService.queryPageListForPrincipalDetail33(principalPeopleDetailSearch);
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");
for(PrincipalPeopleDetail s: pageList.getRecords()){
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
for (PrincipalPeopleDetail s : pageList.getRecords()) {
String key = String.valueOf(s.getChargeUse());
String payment_charge_use = sysBaseAPI.translateDict("payment_charge_use", key);
s.setChargeUse_text(payment_charge_use);
}
//处理为空数据为0
for (PrincipalPeopleDetail s : pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
//处理为空数据为0
for(PrincipalPeopleDetail s: pageList.getRecords()) {
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
}
hashMap.put("sumOfMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney",ObjectUtils.isEmpty(allMoney)?0:allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
hashMap.put("sumOfMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getAllMoney());
hashMap.put("sumOfReallyMoney", ObjectUtils.isEmpty(allMoney) ? 0 : allMoney.getComeAllMoney());
hashMap.put("pageList", pageList);
return Result.OK(hashMap);
}
/**
*个人来款统计导出
*
* 个人来款统计导出
*/
@RequiresPermissions("individualPaymentStatistics:export")
@AutoLog(value = "个人来款统计导出-导出统计")
@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(",")));
//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()));
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(",")));
//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<PrincipalPeopleList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PrincipalPeopleList.class, "个人来款");
idList.addAll(allDepartIds);
//项目负责人
} else if (roleCodes.contains(constant.XMFZR)) {
String userId = sysUser.getId();
idList.add(userId);
} else {
ArrayList<PrincipalPeopleList> objects = new ArrayList<>();
return AmountUtil.exportListXls(objects, PrincipalPeopleList.class, "个人来款");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
//处理为空数据为0
for (PrincipalPeopleList 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.getFinishRate() == null || s.getFinishRate().equals("")) {
s.setFinishRate("0.00%");
}
List<PrincipalPeopleList> pageList = payWorkingGroupService.queryPageListForPrincipalExcel(principalPeopleSearch, idList);
//处理为空数据为0
for(PrincipalPeopleList 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.getFinishRate() == null || s.getFinishRate().equals("")){
s.setFinishRate("0.00%");
}
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleList.class, "个人来款");
}
/**
*个人来款统详情计导出
*
* 个人来款统详情计导出
*/
@AutoLog(value = "个人来款统详情计导出-导出统计")
@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);
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);
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
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);
if (s.getAllMoney() == null || s.getAllMoney().equals("")) {
s.setAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
if (s.getComeAllMoney() == null || s.getComeAllMoney().equals("")) {
s.setComeAllMoney("0.00");
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
}
return AmountUtil.exportListXls(pageList, PrincipalPeopleDetail.class, "个人来款详情");
}
@@ -10,4 +10,6 @@ public class AllMoney {
private String allMoney;
private String comeAllMoney;
private String billMoney;
}
@@ -30,6 +30,10 @@ public class AllProjectStatistics {
@ApiModelProperty(value = "实收总金额")
private String comeAllMoney;
@Excel(name = "开票金额", width = 15)
@ApiModelProperty(value = "开票金额")
private String billMoney;
@ApiModelProperty(value = "来款用途编码")
private String chargeUse;
@@ -45,5 +45,12 @@ public class AllProjectStatisticsSearch {
@ApiModelProperty(value = "部门编码")
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 = "应收总金额范围")
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 = "应收总金额范围")
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 = "应收总金额范围")
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 = "部门编码")
private String departCode;
@ApiModelProperty(value = "开票年份")
private String billYear;
@ApiModelProperty(value = "字段")
private String column;
@ApiModelProperty(value = "排序规则")
private String order;
}