This commit is contained in:
杜建超 2020-09-29 20:10:41 +08:00
parent ea287c6ae3
commit af1486b48e
3 changed files with 23 additions and 37 deletions

View File

@ -194,35 +194,6 @@ public class TestController {
collect1 = collect.stream().map(o -> o.toString()).collect(Collectors.toList());
System.out.println();
}
staffIds.removeAll(collect1);
staffIds.forEach(new Consumer<String>() {
@Override
public void accept(String s) {
List<RecordAuth> listAuth = new ArrayList<>();
try {
ResultRecord resultRecord = resultRecordService.initResult(Long.valueOf(s), 2, 8l);
} catch (Exception e) {
log.info("失败账户" + s);
log.error("" ,e);
return;
}
//ResultRecord resultRecord = resultRecordService.createResultRecord(Long.valueOf(s), 1, 7l);
System.out.println();
/* DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectByStaffId(Long.valueOf(s));
DepartmentsEntity departmentsEntity = departmentsService.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
StaffEntity staffEntity = staffService.selectStaffById(Long.valueOf(s));
ResultRecord resultRecord = new ResultRecord();
resultRecord.setStaffId(Long.valueOf(s));
resultRecord.setType(2);
resultRecord.setDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
resultRecord.setDepartmentName(departmentsEntity.getDepartmentName());
resultRecord.setStaffName(staffEntity.getName());
//resultRecord.setFlowStaffIdRole();
resultRecordService.insertResultRecord(resultRecord);*/
}
});
System.out.println();
}

View File

@ -26,6 +26,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@ -419,6 +420,13 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
}
//获取人员个数去重
List<String> staffs = list.stream().map(e -> e.getStaffId() + "").collect(Collectors.toList());
staffs.removeIf(s -> {
StaffOccupationInfoDto occupationByStaffId = staffOccupationService.getOccupationByStaffId(Long.valueOf(s));
if(occupationByStaffId==null || "1".equals(occupationByStaffId.getStaffStatus())){
return true;
}
return false;
});
List<String> staffdistincts = staffs.stream().distinct().collect(Collectors.toList());
return staffdistincts;

View File

@ -78,13 +78,20 @@ public class ChartServiceImpl implements ChartService {
List<GraphicsStatisticalDto> dtos = new ArrayList<>();
//获取所有人员总数
List<String> allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(departmentId);
int total = staffService.staffsByAllDeparmentIds(allDeparmentIds).size();
//已提交
int commit = resultRecordService.count(new QueryWrapper<ResultRecord>()
//审核中
int apprvel = resultRecordService.count(new QueryWrapper<ResultRecord>()
.eq("is_delete", type==1?2:0)
.eq("type", type)
.like("month_time",monthTime)
.ne("status", ResultRecordStatusEnum.CREATE.getStatus())
.in("status", ResultRecordStatusEnum.AUDIT.getStatus(),ResultRecordStatusEnum.WAIT_COMMIT.getStatus(),ResultRecordStatusEnum.REJECT.getStatus(),ResultRecordStatusEnum.APPEAL.getStatus())
.in("department_id",allDeparmentIds)
.select("DISTINCT staff_id"));
int noCommit = resultRecordService.count(new QueryWrapper<ResultRecord>()
.eq("is_delete", type==1?2:0)
.eq("type", type)
.like("month_time",monthTime)
.eq("status", ResultRecordStatusEnum.CREATE.getStatus())
.in("department_id",allDeparmentIds)
.select("DISTINCT staff_id"));
//已完成
@ -97,9 +104,9 @@ public class ChartServiceImpl implements ChartService {
.select("DISTINCT staff_id"));
GraphicsStatisticalDto dto = new GraphicsStatisticalDto();
if(total-commit>0){
if(noCommit>0){
dto.setCategory("未提交");
dto.setNumber(total-commit);
dto.setNumber(noCommit);
dtos.add(dto);
}
if(finished>0){
@ -108,10 +115,10 @@ public class ChartServiceImpl implements ChartService {
dto.setNumber(finished);
dtos.add(dto);
}
if(commit-finished>0){
if(apprvel>0){
dto = new GraphicsStatisticalDto();
dto.setCategory("审核中");
dto.setNumber(commit-finished);
dto.setNumber(apprvel);
dtos.add(dto);
}
return dtos;