Browse Source

#双票统计

zhongwei
yang_shj 1 year ago
parent
commit
693b7885d9
  1. 15
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

15
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/CensServiceImpl.java

@ -66,7 +66,7 @@ public class CensServiceImpl implements CensService {
// 操作票查询 // 操作票查询
LambdaQueryWrapper operateWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery() LambdaQueryWrapper operateWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery()
.between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime())
.in(StandardTicketInfoEntity::getCreateDept,depts); .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList()));
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getFlowTaskName())){
operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName());
} }
@ -74,7 +74,7 @@ public class CensServiceImpl implements CensService {
// 工作票查询 // 工作票查询
LambdaQueryWrapper workWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery() LambdaQueryWrapper workWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery()
.between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime())
.in(StandardTicketInfoEntity::getCreateDept,depts); .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList()));
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getFlowTaskName())){
workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName());
} }
@ -92,7 +92,7 @@ public class CensServiceImpl implements CensService {
if(CollectionUtil.isEmpty(works)){ if(CollectionUtil.isEmpty(works)){
cens.setWorkCount(0L); cens.setWorkCount(0L);
}else{ }else{
cens.setOperateCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId())).count()); cens.setWorkCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId())).count());
} }
cens.setWorkTaskCount((long)new Random().nextInt(10)); cens.setWorkTaskCount((long)new Random().nextInt(10));
return cens; return cens;
@ -141,7 +141,7 @@ public class CensServiceImpl implements CensService {
// 操作票查询 // 操作票查询
LambdaQueryWrapper operateWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery() LambdaQueryWrapper operateWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery()
.between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime())
.in(StandardTicketInfoEntity::getCreateDept,depts); .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList()));
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getFlowTaskName())){
operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); operateWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName());
} }
@ -149,7 +149,7 @@ public class CensServiceImpl implements CensService {
// 工作票查询 // 工作票查询
LambdaQueryWrapper workWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery() LambdaQueryWrapper workWrapper = Wrappers.<StandardTicketInfoEntity>lambdaQuery()
.between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime()) .between(StandardTicketInfoEntity::getCreateTime,param.getStartTime(),param.getEndTime())
.in(StandardTicketInfoEntity::getCreateDept,depts); .in(StandardTicketInfoEntity::getCreateDept,depts.stream().map(Dept::getId).collect(Collectors.toList()));
if(!StringUtil.isEmpty(param.getFlowTaskName())){ if(!StringUtil.isEmpty(param.getFlowTaskName())){
workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName()); workWrapper.eq("FLOW_TASK_NAME",param.getFlowTaskName());
} }
@ -158,6 +158,7 @@ public class CensServiceImpl implements CensService {
CensYearVo censYear = new CensYearVo(); CensYearVo censYear = new CensYearVo();
censYear.setDeptId(dept.getId()); censYear.setDeptId(dept.getId());
censYear.setDeptName(dept.getDeptName()); censYear.setDeptName(dept.getDeptName());
List<CensVo> censs = new ArrayList<>();
for(int mon = 1 ; mon <= 12 ;mon++){ for(int mon = 1 ; mon <= 12 ;mon++){
String strMon = param.getYear() + "-" + (mon > 9 ? mon : "0" + mon); String strMon = param.getYear() + "-" + (mon > 9 ? mon : "0" + mon);
CensVo cens = new CensVo(); CensVo cens = new CensVo();
@ -170,10 +171,12 @@ public class CensServiceImpl implements CensService {
if(CollectionUtil.isEmpty(works)){ if(CollectionUtil.isEmpty(works)){
cens.setWorkCount(0L); cens.setWorkCount(0L);
}else{ }else{
cens.setOperateCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId()) && DateUtil.format(work.getCreateTime(),"yyyy-MM").equals(strMon)).count()); cens.setWorkCount(works.stream().filter(work->work.getCreateDept().equals(dept.getId()) && DateUtil.format(work.getCreateTime(),"yyyy-MM").equals(strMon)).count());
} }
cens.setWorkTaskCount((long)new Random().nextInt(10)); cens.setWorkTaskCount((long)new Random().nextInt(10));
censs.add(cens);
} }
censYear.setCenss(censs);
return censYear; return censYear;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }

Loading…
Cancel
Save