Browse Source

ticket 两票统计修改

zhongwei
段飞宇 1 year ago
parent
commit
c3e5879c39
  1. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java
  2. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java
  3. 16
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java
  4. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/StandardTicketInfoServiceImpl.java

@ -712,7 +712,9 @@ public class StandardTicketInfoServiceImpl extends BaseServiceImpl<StandardTicke
public List<StandardTicketInfoEntity> selectStandardTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
QueryWrapper<StandardTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(StandardTicketInfoEntity::getTicketType, ticketType);
if (CollectionUtils.isNotEmpty(createDept)){
queryWrapper.lambda().in(StandardTicketInfoEntity::getCreateDept, createDept);
}
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}", dateTime);
return baseMapper.selectList(queryWrapper);
}

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/utils/OperationWordHelper.java

@ -44,8 +44,10 @@ public class OperationWordHelper {
switch (status) {
case 1:
result = "电气操作票.docx";
break;
default:
result = "电气操作票.docx";
break;
}
return result;
}

16
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketCountServiceImpl.java

@ -82,9 +82,13 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
@SneakyThrows
@Override
public void loadMonthReport(String dateTime) {
//根据登录人查询所属机构及下属机构
BladeUser user = AuthUtil.getUser();
List<Long> createDept = userClient.getDataScope(user.getUserId());
LambdaQueryWrapper<TicketCount> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(TicketCount::getDateTime, dateTime);
//根据月份查询统计的数据
CompletableFuture<List<TicketCount>> ticketCountsCompletableFuture = CompletableFuture.supplyAsync(() -> {
LambdaQueryWrapper<TicketCount> queryWrapper = new LambdaQueryWrapper<>();
@ -92,6 +96,7 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
List<TicketCount> ticketCounts = baseMapper.selectList(queryWrapper);
return ticketCounts;
}, executor);
//第一种工作票
CompletableFuture<Void> oneTicketCompletableFuture = ticketCountsCompletableFuture.thenAcceptAsync((items) -> {
//查询第一种工作票
@ -324,10 +329,15 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
ticketCount.setTenantId(user.getTenantId());
ticketCount.setCreateDept(Long.valueOf(user.getDeptId()));
ticketCount.setCreateUser(user.getUserId());
if (entry.getKey() == null) {
continue;
}
if (entry.getKey() != null) {
//根据id获取部门名称
R<String> deptName = systemClient.getDeptName(entry.getKey());
if (deptName.isSuccess()) {
ticketCount.setDeptName(deptName.getData());
ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData());
}
}
List<StandardTicketInfoEntity> values = entry.getValue();
ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getTicketType() : ticketType);
@ -389,10 +399,12 @@ public class TicketCountServiceImpl extends BaseServiceImpl<TicketCountMapper, T
TicketCount ticketCount = new TicketCount();
ticketCount.setDeptId(entry.getKey());
ticketCount.setDateTime(dateTime);
if (entry.getKey() != null) {
//根据id获取部门名称
R<String> deptName = systemClient.getDeptName(entry.getKey());
if (deptName.isSuccess()) {
ticketCount.setDeptName(deptName.getData());
ticketCount.setDeptName(deptName.getData() == null ? "" : deptName.getData());
}
}
List<WorkTicketInfoEntity> values = entry.getValue();
ticketCount.setTicketType(CollectionUtils.isNotEmpty(values) ? values.get(0).getType() : ticketType);

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/workTicket/service/impl/WorkTicketInfoServiceImpl.java

@ -1104,7 +1104,10 @@ public class WorkTicketInfoServiceImpl extends BaseServiceImpl<WorkTicketInfoMap
public List<WorkTicketInfoEntity> selectTicketByDeptIdWithTicketType(List<Long> createDept, String ticketType, String dateTime) {
QueryWrapper<WorkTicketInfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(WorkTicketInfoEntity::getType, ticketType);
if (CollectionUtils.isNotEmpty(createDept)) {
queryWrapper.lambda().in(BaseEntity::getCreateDept, createDept);
}
queryWrapper.apply("date_format(CREATE_TIME,'%Y-%m') = {0}" , dateTime);
return baseMapper.selectList(queryWrapper);
}

Loading…
Cancel
Save