|
@@ -37,6 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
@@ -108,6 +109,9 @@ public class ReportLossesDetailsServiceImpl extends ServiceImpl<ReportLossesDeta
|
|
|
wrapper.in("rld", ReportLossesDetails::getCompanyId, SecurityUtils.getCompanyIds());
|
|
|
wrapper.eq("rld", ReportLossesDetails::getCompanyId, dto.getCompanyId());
|
|
|
|
|
|
+ //工序id过滤
|
|
|
+ wrapper.eq("rld", ReportLossesDetails::getProcessId, dto.getProcessId());
|
|
|
+
|
|
|
|
|
|
wrapper.groupBy("rld.id");
|
|
|
|
|
@@ -123,9 +127,18 @@ public class ReportLossesDetailsServiceImpl extends ServiceImpl<ReportLossesDeta
|
|
|
List<Long> companyIds = records.stream().map(ReportLossesDetailsVo::getCompanyId).collect(Collectors.toList());
|
|
|
Map<Long, String> companyNameMap = DeptUstil.getDeptNameMap(companyIds);
|
|
|
|
|
|
+ //获取工序信息
|
|
|
+ List<Long> ppIds = records.stream().map(ReportLossesDetails::getProcessId).collect(Collectors.toList());
|
|
|
+ Map<Long, String> ppMap = new HashMap<>();
|
|
|
+ if (ObjectUtil.isNotEmpty(ppIds)) {
|
|
|
+ ppMap = productionProcessesService.mapKV(ProductionProcesses::getId, ProductionProcesses::getName, q -> q.in(ProductionProcesses::getId, ppIds));
|
|
|
+ }
|
|
|
for (ReportLossesDetailsVo record : records) {
|
|
|
//赋值生产公司名称
|
|
|
record.setCompanyName(companyNameMap.get(record.getCompanyId()));
|
|
|
+
|
|
|
+ //赋值工序名称
|
|
|
+ record.setProcessName(ppMap.get(record.getProcessId()));
|
|
|
}
|
|
|
|
|
|
//赋值产品信息
|
|
@@ -217,7 +230,7 @@ public class ReportLossesDetailsServiceImpl extends ServiceImpl<ReportLossesDeta
|
|
|
stockWait.setBusinessId(dto.getId());
|
|
|
stockWait.setStatus(0);
|
|
|
|
|
|
- if (ObjectUtil.isEmpty(productionOrder)) {
|
|
|
+ if (ObjectUtil.isNotEmpty(productionOrder)) {
|
|
|
stockWait.setBusinessCode(productionOrder.getCode());
|
|
|
}
|
|
|
|