| | |
| | | insOrderPlanDTO.setUserId(null); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | insOrderPlanDTO.setSonLaboratory(null); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userName, sonLaboratory, laboratory); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | |
| | | break; |
| | | } |
| | | |
| | | //如果是大样品下的项目为空,那么查询第一个光纤的项目 |
| | | if (ObjectUtils.isEmpty(insProducts) && type==0){ |
| | | //查询第一个光纤的id |
| | | List<InsFiber> insFibers = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, id)).get(0).getId())); |
| | | insProducts = insSampleMapper.getInsProduct3(insFibers.get(0).getId()); |
| | | } |
| | | Set<Integer> set = new HashSet<>(); |
| | | Map<Integer, String> map2 = new HashMap<>(); |
| | | if (BeanUtil.isEmpty(insProducts)) return null; |
| | |
| | | for (InsFibers insFiber : insFibers) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFibersId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | } else { |
| | |
| | | for (InsFiber insFiber : fiberList) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | } else { |
| | |
| | | for (InsFiber insFiber : insFiberList) { |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().eq(InsProduct::getInsFiberId, insFiber.getId())); |
| | | List<Integer> collect = insProducts.stream().map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | } else { |
| | |
| | | .eq(InsProduct::getInsBushId, insBushing.getId())); |
| | | List<Integer> collect = insProducts.stream() |
| | | .map(InsProduct::getInsResult) |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm!=2).collect(Collectors.toList()); |
| | | .filter(sm -> ObjectUtils.isNotEmpty(sm) && sm != 2).collect(Collectors.toList()); |
| | | if (insProducts.size() == collect.size()) { |
| | | insBushing.setState(1);//已检验 |
| | | } else { |
| | |
| | | insProduct.setId(Integer.parseInt(k)); |
| | | List<InsProductResult> results = insProductResultMapper.selectList(Wrappers.<InsProductResult>lambdaQuery() |
| | | .eq(InsProductResult::getInsProductId, insProduct.getId())); |
| | | InsProduct product = insProductMapper.selectById(insProduct.getId()); |
| | | InsProductResult result; |
| | | if (CollectionUtils.isEmpty(results)) { |
| | | result = new InsProductResult(); |
| | |
| | | insProductResultMapper.deleteById(insProductResultss.get(i)); |
| | | } |
| | | } |
| | | InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k))); |
| | | //InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k))); |
| | | //检验值 |
| | | if (jo.get("insValue") != null) { |
| | | JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue"))); |
| | |
| | | |
| | | /*如果是第一次选择设备信息,且还有其余样品也有同一个经验项目,那么所有样品的该项目都用这个设备信息*/ |
| | | //先查询是否还有其余样品 |
| | | InsProduct product = insProductMapper.selectById(insProduct.getId()); |
| | | |
| | | Integer insSampleId = product.getInsSampleId(); |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, insSampleMapper.selectById(insSampleId).getInsOrderId())); |
| | | //如果有多个样品或者是不是采集类型就同一个设备 |
| | | if (insSamples.size() > 1 && !product.getInspectionItemType().equals("1")) { |
| | | //存在其余样品,查询是否有同一种检验项目 |
| | | for (InsSample sample : insSamples.stream().filter(insSample -> !insSample.getId().equals(insSampleId)).collect(Collectors.toList())) { |
| | |
| | | .eq(InsProduct::getInspectionItemSubclassEn, product.getInspectionItemSubclassEn()) |
| | | .eq(InsProduct::getTemplateId, product.getTemplateId()) |
| | | .eq(InsProduct::getStandardMethodListId, product.getStandardMethodListId()) |
| | | .eq(InsProduct::getInsBushId,product.getInsBushId()) |
| | | .eq(InsProduct::getInsFibersId,product.getInsFibersId()) |
| | | .eq(InsProduct::getInsFiberId,product.getInsFiberId()) |
| | | .eq(InsProduct::getInsBushId, product.getInsBushId()) |
| | | .eq(InsProduct::getInsFibersId, product.getInsFibersId()) |
| | | .eq(InsProduct::getInsFiberId, product.getInsFiberId()) |
| | | ); |
| | | if (ObjectUtils.isNotEmpty(product1)) { |
| | | //如果存在项目,查询是否有表 |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | insProduct.setUpdateUser(userId); |
| | | insProductMapper.updateById(insProduct); |
| | | insProductUserMapper.insert(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); |
| | |
| | | isWithinRange = !now.isBefore(startTime) || !now.isAfter(endTime); |
| | | } |
| | | //加班 |
| | | AuxiliaryOutputWorkingHours count1 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() |
| | | List<AuxiliaryOutputWorkingHours> count1s = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() |
| | | .eq(AuxiliaryOutputWorkingHours::getCheck, userId) |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItem, insProduct.getInspectionItem()) |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItemSubclass, insProduct.getInspectionItemSubclass()) |
| | | .eq(AuxiliaryOutputWorkingHours::getOvertimeOrderNo, insOrder.getEntrustCode()) |
| | | .eq(AuxiliaryOutputWorkingHours::getSample, insSampleMapper.selectById(insProduct.getInsSampleId()).getSampleCode())); |
| | | if (count1s.size() > 1) { |
| | | for (int i = 1; i < count1s.size(); i++) { |
| | | auxiliaryOutputWorkingHoursMapper.deleteById(count1s.get(i)); |
| | | } |
| | | } |
| | | //非加班 |
| | | AuxiliaryOutputWorkingHours count2 = auxiliaryOutputWorkingHoursMapper.selectOne(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() |
| | | List<AuxiliaryOutputWorkingHours> count2s = auxiliaryOutputWorkingHoursMapper.selectList(Wrappers.<AuxiliaryOutputWorkingHours>lambdaQuery() |
| | | .eq(AuxiliaryOutputWorkingHours::getCheck, userId) |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItem, insProduct.getInspectionItem()) |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItemSubclass, insProduct.getInspectionItemSubclass()) |
| | | .eq(AuxiliaryOutputWorkingHours::getOrderNo, insOrder.getEntrustCode()) |
| | | .eq(AuxiliaryOutputWorkingHours::getSample, insSampleMapper.selectById(insProduct.getInsSampleId()).getSampleCode())); |
| | | if (ObjectUtils.isNotEmpty(insProduct.getManHour()) && ObjectUtils.isEmpty(count2) && ObjectUtils.isEmpty(count1)) { |
| | | if (count2s.size() > 1) { |
| | | for (int i = 1; i < count2s.size(); i++) { |
| | | auxiliaryOutputWorkingHoursMapper.deleteById(count2s.get(i)); |
| | | } |
| | | } |
| | | if (ObjectUtils.isNotEmpty(insProduct.getManHour()) && CollectionUtils.isEmpty(count2s) && CollectionUtils.isEmpty(count1s)) { |
| | | AuxiliaryOutputWorkingHours auxiliaryOutputWorkingHours = new AuxiliaryOutputWorkingHours(); |
| | | if (isWithinRange) { |
| | | //在时间内就是正常上班 |
| | |
| | | auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//周次 |
| | | auxiliaryOutputWorkingHours.setCheck(userId);//检测人 |
| | | } |
| | | if (ObjectUtils.isEmpty(insProductResult) && !result.getInsValue().equals("[]") || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()) && !insProductResult.getInsValue().equals("[]"))) { |
| | | auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); |
| | | try { |
| | | if (CollectionUtils.isEmpty(insProductResultss) && !result.getInsValue().equals("[]") || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getInsValue().equals(result.getInsValue()) && !insProductResultss.get(0).getInsValue().equals("[]"))) { |
| | | auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); |
| | | } |
| | | }catch (Exception e){ |
| | | System.out.println("工时新增不成功!!!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | Long l1 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, insSample.getId()) |
| | | .and(wrapper -> wrapper |
| | | .isNull(InsProduct::getInsResult) |
| | | .isNotNull(InsProduct::getInsResult) |
| | | .or() |
| | | .eq(InsProduct::getInsResult, 2) |
| | | .ne(InsProduct::getInsResult, 2) |
| | | )); |
| | | if (l == l1) { |
| | | insSample.setInsState(2); |
| | |
| | | textRenderData.setText("✔"); |
| | | break; |
| | | case 0: |
| | | resultCh.set(resultCh.get() + "、" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass())); |
| | | resultEn.set(resultEn.get() + "、" + p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn())); |
| | | Set<String> uniqueItems1 = new HashSet<>(); |
| | | Set<String> uniqueItems2 = new HashSet<>(); |
| | | |
| | | String item1 = p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass()); |
| | | if (uniqueItems1.add(item1)) { |
| | | resultCh.set(resultCh.get() + "、" + item1); |
| | | } |
| | | //resultCh.set(resultCh.get() + "、" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass())); |
| | | String item2 = p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn()); |
| | | if (uniqueItems2.add(item2)) { |
| | | resultEn.set(resultEn.get() + "、" + item2); |
| | | } |
| | | //resultEn.set(resultEn.get() + "、" + ); |
| | | textRenderData.setText("✖"); |
| | | break; |
| | | default: |
| | |
| | | put("createTime", now.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); |
| | | put("createTimeEn", monthNames[now.getMonthValue() - 1] + " " + now.getDayOfMonth() + ", " + now.getYear()); |
| | | put("insTime", insOrder.getInsTime().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日"))); |
| | | put("insTimeEn", monthNames[insOrder.getInsTime().getMonthValue() - 1] + " " + now.getDayOfMonth() + ", " + now.getYear()); |
| | | put("insTimeEn", monthNames[insOrder.getInsTime().getMonthValue() - 1] + " " + insOrder.getInsTime().getDayOfMonth() + ", " + insOrder.getInsTime().getYear()); |
| | | put("writeUrl", null); |
| | | put("insUrl", Pictures.ofLocal(imgUrl + "/" + signatureUrl).create()); |
| | | put("images", images); |