| | |
| | | otherParam.setIsOrderAll(isOrderAll); |
| | | otherParam.setCheckUserFlag(checkUserFlag); |
| | | otherParam.setCheckUserId(SecurityUtils.getUserId()); |
| | | return insOrderMapper.selectInsOrderPage(page, QueryWrappers.queryWrappers(sampleOrderDto), otherParam); |
| | | IPage<SampleOrderDto> sampleOrderDtoIPage = insOrderMapper.selectInsOrderPage(page, QueryWrappers.queryWrappers(sampleOrderDto), otherParam); |
| | | // 拼接检验人根据检验项来 |
| | | if(CollectionUtils.isEmpty(sampleOrderDtoIPage.getRecords())){ |
| | | return sampleOrderDtoIPage; |
| | | } |
| | | List<Integer> orderIds = new ArrayList<>(); |
| | | for (SampleOrderDto record : sampleOrderDtoIPage.getRecords()) { |
| | | orderIds.add(record.getId()); |
| | | } |
| | | List<CheckUserDto> checkUserDtoList = insProductMapper.selectCheckUserNameByOrderIds(orderIds); |
| | | for (SampleOrderDto record : sampleOrderDtoIPage.getRecords()) { |
| | | Integer orderId = record.getId(); |
| | | for (CheckUserDto checkUserDto : checkUserDtoList) { |
| | | if(orderId.equals(checkUserDto.getOrderId())) { |
| | | record.setTestingName(checkUserDto.getCheckUserNames()); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return sampleOrderDtoIPage; |
| | | } |
| | | |
| | | |
| | |
| | | auxiliaryOutputWorkingHours.setCheck(userId);//检测人 |
| | | auxiliaryOutputWorkingHours.setPrice(insProduct.getPrice());//单价 |
| | | auxiliaryOutputWorkingHours.setSampleId(insProduct.getInsSampleId());//样品id |
| | | auxiliaryOutputWorkingHours.setInsProductId(insProduct.getId());//检验项id |
| | | auxiliaryOutputWorkingHours.setInsProductId(Math.toIntExact(insProduct.getId()));//检验项id |
| | | |
| | | return auxiliaryOutputWorkingHours; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | // 初次分配检验人,各个检验项默认订单的检验人 |
| | | List<Integer> insProductIds = insProductList.stream().map(insproduct -> { |
| | | return insproduct.getId(); |
| | | return Math.toIntExact(insproduct.getId()); |
| | | }).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(insProductIds)){ |
| | | insProductMapper.batchUpdateInsProductCheckUserId(insProductIds, userId); |
| | |
| | | ip2.addAll(insProducts); |
| | | } |
| | | for (InsProduct product : ip2) { |
| | | product.setStandardMethodListId(a.getInsulating().getStandardMethodListId()); |
| | | product.setStandardMethodListId(Long.valueOf(a.getInsulating().getStandardMethodListId())); |
| | | } |
| | | addInsProductMethod(a.getId(), ip2); |
| | | } |
| | |
| | | ip2.addAll(insProducts); |
| | | } |
| | | for (InsProduct product : ip2) { |
| | | product.setStandardMethodListId(a.getAuxiliaryWireCore().getStandardMethodListId()); |
| | | product.setStandardMethodListId(Long.valueOf(a.getAuxiliaryWireCore().getStandardMethodListId())); |
| | | } |
| | | addInsProductMethod(a.getId(), ip2); |
| | | } |