diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 8f829999..189de200 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -156,7 +156,6 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl { - if (ObjectUtil.isEmpty(item.getRepairIds()) || ObjectUtil.isEmpty(item.getSaleId())){ + if (ObjectUtil.isEmpty(item.getRepairIds()) || ObjectUtil.isEmpty(item.getSaleId())) { String message = ""; - switch (item.getItemType()){ + switch (item.getItemType()) { case "01": message += "项目:"; break; @@ -327,7 +326,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_UNIT); - Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); + Map unitMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue, DictDataRespDTO::getLabel)); Set ids = wares.stream().map(DlRepairTitemReqVO::getPartId).collect(Collectors.toSet()); List repairWares = waresService.listByIds(ids); @@ -351,8 +350,8 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl records = repairRecordsService.queryList(entity); // 操作记录类型 List recordTypeList = dictDataApi.getDictDataList(DICT_REPAIR_RECORDS_TYPE); - Map typeMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue,DictDataRespDTO::getLabel)); - result.setRecords(records.stream().peek(item->item.setType(typeMap.get(item.getType()))).collect(Collectors.toList())); + Map typeMap = recordTypeList.stream().collect(Collectors.toMap(DictDataRespDTO::getValue, DictDataRespDTO::getLabel)); + result.setRecords(records.stream().peek(item -> item.setType(typeMap.get(item.getType()))).collect(Collectors.toList())); return result; } @@ -380,7 +379,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl().eq(RepairOrderInfo::getGoodsId, repairTicketsRespVO.getId())); - if (ObjectUtil.isEmpty(one)){ + if (ObjectUtil.isEmpty(one)) { throw exception0(500, "系统异常"); } RepairOrderInfo repairOrderInfo = new RepairOrderInfo(); @@ -425,6 +424,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl status = new ArrayList<>(); status.add("01"); // 待审核 @@ -873,16 +873,16 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl delItems = AllItems.stream().filter(item -> item.getItemCount() == 0).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(delItems)){ + if (CollectionUtil.isNotEmpty(delItems)) { // 删除需要删的 titemService.removeBatchByIds(delItems); Set delIds = delItems.stream().map(DlRepairTitem::getId).collect(Collectors.toSet()); // 得到需要改的 List updateItems = AllItems.stream().filter(item -> delIds.contains(item.getId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(updateItems)){ + if (CollectionUtil.isNotEmpty(updateItems)) { titemService.updateBatchById(updateItems); } - }else { + } else { // 没有需要删的就是全部都需要改 titemService.updateBatchById(AllItems); } @@ -922,21 +922,21 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl getBossNum() { - Map rtnMap = new HashMap<>(); + Map rtnMap = new HashMap<>(); int workingNum = 0; int doneNum = 0; List repairTickets = this.list(); - if(!repairTickets.isEmpty()){ - Map> ifFinishMap = repairTickets.stream().collect(Collectors.groupingBy(DlRepairTickets::getIsFinish)); - if(ifFinishMap.containsKey("0")){ + if (!repairTickets.isEmpty()) { + Map> ifFinishMap = repairTickets.stream().collect(Collectors.groupingBy(DlRepairTickets::getIsFinish)); + if (ifFinishMap.containsKey("0")) { workingNum = ifFinishMap.get("0").size(); } - if(ifFinishMap.containsKey("1")){ + if (ifFinishMap.containsKey("1")) { doneNum = ifFinishMap.get("1").size(); } } - rtnMap.put("workingNum",workingNum); - rtnMap.put("doneNum",doneNum); + rtnMap.put("workingNum", workingNum); + rtnMap.put("doneNum", doneNum); return rtnMap; } @@ -975,13 +975,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl { - if (ObjectUtil.isEmpty(item.getRepairIds())){ + if (ObjectUtil.isEmpty(item.getRepairIds())) { throw exception0(500, "施工人员尚未设置"); } - if (ObjectUtil.isEmpty(item.getSaleId())){ + if (ObjectUtil.isEmpty(item.getSaleId())) { throw exception0(500, "销售人员尚未设置"); } }); @@ -1046,7 +1046,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl tickets = baseMapper.selectList(new LambdaQueryWrapper().eq(DlRepairTickets::getTicketsWorkStatus, "05")); // 如果没有,直接退出 - if (CollectionUtil.isEmpty(tickets)){ + if (CollectionUtil.isEmpty(tickets)) { return; } // 获取超时自动总检配置的时间 List dataList = dictDataApi.getDictDataList(BaseConstants.AUTO_INSPECTION); // 理论上是只有一个的,但防止被删了或者别的什么原因,直接报错 DictDataRespDTO dictDataRespDTO = dataList.stream().findFirst().orElse(null); - if (ObjectUtil.isEmpty(dictDataRespDTO)){ + if (ObjectUtil.isEmpty(dictDataRespDTO)) { log.error("超时自动总检时间没有配置"); return; } @@ -1085,7 +1085,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl ids = permissionApi.getUserIdByRoleId(roleInfo.getId()); // 如果没有总检,直接报错退出 - if (CollectionUtil.isEmpty(ids)){ + if (CollectionUtil.isEmpty(ids)) { log.error("系统中没有总检"); return; } @@ -1111,7 +1111,7 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl