补贴员工列表接口添加非空判断

master 22
hshansha 7 months ago
parent 634c4a3f78
commit aff95ee864

@ -1,14 +1,17 @@
/*
package com.ruoyi.test; package com.ruoyi.test;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
*/
/** /**
* *
* *
* @author Lion Li * @author Lion Li
*/ *//*
@DisplayName("断言单元测试案例") @DisplayName("断言单元测试案例")
public class AssertUnitTest { public class AssertUnitTest {
@ -43,3 +46,4 @@ public class AssertUnitTest {
} }
} }
*/

@ -1,13 +1,16 @@
/*
package com.ruoyi.test; package com.ruoyi.test;
import org.junit.jupiter.api.*; import org.junit.jupiter.api.*;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
*/
/** /**
* *
* *
* @author Lion Li * @author Lion Li
*/ *//*
@SpringBootTest @SpringBootTest
@DisplayName("标签单元测试案例") @DisplayName("标签单元测试案例")
public class TagUnitTest { public class TagUnitTest {
@ -52,3 +55,4 @@ public class TagUnitTest {
} }
*/

@ -151,6 +151,7 @@ public class PayButieEmplyeeController extends BaseController {
@SaCheckPermission("pay:butieEmplyee:list") @SaCheckPermission("pay:butieEmplyee:list")
@GetMapping("/summary") @GetMapping("/summary")
public TableDataInfo<ButieSummaryVo> summary(PayButieEmplyeeBo bo, PageQuery pageQuery) { public TableDataInfo<ButieSummaryVo> summary(PayButieEmplyeeBo bo, PageQuery pageQuery) {
List<ButieSummaryVo> butieSummaryVos = new ArrayList<>();
String date; String date;
if (null==(bo.getDate())) { // 默认查询本月的数据 if (null==(bo.getDate())) { // 默认查询本月的数据
date = DateUtil.format(new Date(), "yyyy-MM"); date = DateUtil.format(new Date(), "yyyy-MM");
@ -161,12 +162,16 @@ public class PayButieEmplyeeController extends BaseController {
employeeInfo.setId(bo.getEmployeeId()); employeeInfo.setId(bo.getEmployeeId());
employeeInfo.setTenantId(bo.getTenantId()); employeeInfo.setTenantId(bo.getTenantId());
TableDataInfo<PayEmployeeInfoVo> payEmployeeTableDataInfo = employeeInfoService.queryPageList(employeeInfo, pageQuery); TableDataInfo<PayEmployeeInfoVo> payEmployeeTableDataInfo = employeeInfoService.queryPageList(employeeInfo, pageQuery);
List<ButieSummaryVo> butieSummaryVos = this.buildEmployeeInfo(payEmployeeTableDataInfo.getRows(), date); if(payEmployeeTableDataInfo.getRows()!=null&&payEmployeeTableDataInfo.getRows().size()>0){
butieSummaryVos = this.buildEmployeeInfo(payEmployeeTableDataInfo.getRows(), date);
}
return TableDataInfo.build(butieSummaryVos); return TableDataInfo.build(butieSummaryVos);
} }
private List<ButieSummaryVo> buildEmployeeInfo(List<PayEmployeeInfoVo> list, String date) { private List<ButieSummaryVo> buildEmployeeInfo(List<PayEmployeeInfoVo> list, String date) {
List<PayButieVo> sgrButies = butieService.queryList(new PayButieBo()); PayButieBo pb = new PayButieBo();
pb.setTenantId(list.get(0).getTenantId());
List<PayButieVo> sgrButies = butieService.queryList(pb);
ArrayList<ButieSummaryVo> summaryVos = new ArrayList<>(); ArrayList<ButieSummaryVo> summaryVos = new ArrayList<>();
list.parallelStream().forEachOrdered(emp -> { list.parallelStream().forEachOrdered(emp -> {
ButieSummaryVo butieSummaryVo = new ButieSummaryVo(); ButieSummaryVo butieSummaryVo = new ButieSummaryVo();

Loading…
Cancel
Save