| | |
| | | |
| | | @Resource |
| | | private InsOrderFileMapper insOrderFileMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | Integer userId =null; |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId()) ) { |
| | | Integer userId = null; |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) { |
| | | userId = map1.get("userId"); |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory,laboratory); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId, sonLaboratory, laboratory); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | IPage<InsOrderPlanTaskSwitchVo> insOrderPage = insSampleMapper.inspectionOrderDetailsTaskSwitching(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId,sonLaboratory,laboratory); |
| | | IPage<InsOrderPlanTaskSwitchVo> insOrderPage = insSampleMapper.inspectionOrderDetailsTaskSwitching(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId, sonLaboratory, laboratory); |
| | | map.put("body", insOrderPage); |
| | | return map; |
| | | } |
| | |
| | | } |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | InsSampleUser insSampleUser = new InsSampleUser(entity.getInsSampleId().intValue(), userId, 1,entity.getSonLaboratory()); |
| | | InsSampleUser insSampleUser = new InsSampleUser(entity.getInsSampleId().intValue(), userId, 1, entity.getSonLaboratory()); |
| | | return insSampleUserMapper.insert(insSampleUser) > 0; |
| | | } |
| | | |
| | |
| | | insProducts = insSampleMapper.getInsProduct3(id); |
| | | break; |
| | | } |
| | | // 数采新增 |
| | | getDeviceMessage(insProducts, request); |
| | | |
| | | Set<Integer> set = new HashSet<>(); |
| | | Map<Integer, String> map2 = new HashMap<>(); |
| | | if (BeanUtil.isEmpty(insProducts)) return null; |
| | | getTemplateThing(set, map2, insProducts); |
| | | return insProducts; |
| | | } |
| | | |
| | | private List<InsProduct> getDeviceMessage(List<InsProduct> insProducts, HttpServletRequest request) { |
| | | String ipAddress = request.getRemoteAddr(); |
| | | // 防止回环地址变为IPv6 |
| | | String ip = ipAddress.equals("0:0:0:0:0:0:0:1") ? "127.0.0.1" : ipAddress; |
| | | insProducts.forEach(i -> { |
| | | Map<String, Object> devices = baseMapper.getDeviceMessage(ip, i.getInspectionItem(), i.getInspectionItemSubclass(), i.getSampleType()); |
| | | if (ObjectUtils.isNotEmpty(devices) && ObjectUtils.isNotEmpty(devices.get("file_type")) && ObjectUtils.isNotEmpty(devices.get("collect_url"))) { |
| | | InsProductResult insProductResult = i.getInsProductResult(); |
| | | if (ObjectUtils.isEmpty(insProductResult)) { |
| | | insProductResult = new InsProductResult(); |
| | | } |
| | | List<Object> list = new ArrayList<>(); |
| | | Map<Object, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("v", devices.get("device_name")); |
| | | list.add(hashMap); |
| | | insProductResult.setEquipName(JSON.toJSON(list).toString()); |
| | | List<Object> listValue = new ArrayList<>(); |
| | | Map<Object, Object> hashMapValue = new HashMap<>(); |
| | | hashMapValue.put("v", devices.get("management_number")); |
| | | listValue.add(hashMapValue); |
| | | insProductResult.setEquipName(JSON.toJSON(list).toString()); |
| | | insProductResult.setEquipValue(JSON.toJSON(listValue).toString()); |
| | | i.setInsProductResult(insProductResult); |
| | | } |
| | | }); |
| | | return insProducts; |
| | | } |
| | | |
| | |
| | | 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)).collect(Collectors.toList()); |
| | | if (insProducts.size()==collect.size()) { |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | }else { |
| | | } else { |
| | | insFiber.setState(0);//未检验 |
| | | } |
| | | } |
| | |
| | | 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)).collect(Collectors.toList()); |
| | | if (insProducts.size()==collect.size()) { |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | }else { |
| | | } else { |
| | | insFiber.setState(0);//未检验 |
| | | } |
| | | } |
| | |
| | | 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)).collect(Collectors.toList()); |
| | | if (insProducts.size()==collect.size()) { |
| | | if (insProducts.size() == collect.size()) { |
| | | insFiber.setState(1);//已检验 |
| | | }else { |
| | | } else { |
| | | insFiber.setState(0);//未检验 |
| | | } |
| | | } |
| | |
| | | //先查出这个样品下有哪些管色标,光纤带,光纤色标 |
| | | //先查出套管 |
| | | List<InsBushing> insBushings = insBushingMapper.selectList(Wrappers.<InsBushing>lambdaQuery().eq(InsBushing::getInsSampleId, sampleId)); |
| | | if (insBushings.size()>0) { |
| | | if (insBushings.size() > 0) { |
| | | //通信--温度循环 |
| | | for (InsBushing insBushing : insBushings) { |
| | | //再查询出所有的光纤带 |
| | |
| | | insProduct.setInsProductResult(insProductResult); |
| | | } |
| | | //求同等条件下1次循环20度常温的计算值 |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId,insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId,sampleId) |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20℃(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId() )); |
| | | if (ObjectUtils.isNotEmpty(insProductResult1) &&!insProductResult1.getComValue().equals("[]")) { |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId())); |
| | | if (ObjectUtils.isNotEmpty(insProductResult1) && !insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | //如果套管下没有光纤带就只有光纤了 |
| | | List<InsFiber> insFiberList = insFiberMapper.selectList(Wrappers.<InsFiber>lambdaQuery().eq(InsFiber::getInsBushingId, insBushing.getId())); |
| | | for (InsFiber fiber : insFiberList) { |
| | |
| | | productVo.setBushColor(fiber.getBushColor()); |
| | | insProduct.setInsProductResult(insProductResult); |
| | | //求同等条件下1次循环20度常温的计算值 |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId,insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId,sampleId) |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20℃(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId() )); |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId())); |
| | | if (ObjectUtils.isNotEmpty(insProductResult1) && !insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | |
| | | } |
| | | } |
| | | productVos = productVos.stream().sorted(Comparator.comparing(productVo -> productVo.getInsProduct().getInspectionItemClass())).collect(Collectors.toList()); |
| | | } |
| | | else { |
| | | } else { |
| | | //电力--热循环和温升试验 |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, sampleId) |
| | |
| | | insProduct.setLastValue(o.equals("") ? null : (o.toString())); |
| | | } |
| | | } catch (Exception e) { |
| | | insProduct.setLastValue("");//'' |
| | | } |
| | | if (jo.get("equipValue") != null) { |
| | | JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("equipValue"))); |
| | |
| | | String ir = JSON.parseObject(JSON.toJSONString(insResult.get("v"))).get("v") + ""; |
| | | insProduct.setInsResult(Integer.parseInt(ir)); |
| | | } catch (Exception e) { |
| | | insProduct.setInsResult(2);//待定 |
| | | } |
| | | if (BeanUtil.isEmpty(result.getId())) { |
| | | result.setCreateUser(userId); |
| | |
| | | PerformanceShift performanceShift = performanceShiftMapper.selectOne(Wrappers.<PerformanceShift>lambdaQuery() |
| | | .eq(PerformanceShift::getUserId, userId) |
| | | .eq(PerformanceShift::getWorkTime, today)); |
| | | if (ObjectUtils.isNotEmpty(performanceShift)){ |
| | | if (ObjectUtils.isNotEmpty(performanceShift)) { |
| | | ShiftTime shiftTime = shiftTimeMapper.selectOne(Wrappers.<ShiftTime>lambdaQuery().eq(ShiftTime::getShift, performanceShift.getShift())); |
| | | if (ObjectUtils.isNotEmpty(shiftTime)){ |
| | | if (ObjectUtils.isNotEmpty(shiftTime)) { |
| | | DateTimeFormatter forma = DateTimeFormatter.ofPattern("HH:mm"); |
| | | LocalTime now = LocalTime.now(); |
| | | LocalTime startTime = LocalTime.parse(shiftTime.getStartTime(), forma); |
| | |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItem, insProduct.getInspectionItem()) |
| | | .eq(AuxiliaryOutputWorkingHours::getInspectionItemSubclass, insProduct.getInspectionItemSubclass()) |
| | | .eq(AuxiliaryOutputWorkingHours::getOrderNo, insOrder.getEntrustCode())); |
| | | if (ObjectUtils.isNotEmpty(insProduct.getManHour())&& ObjectUtils.isEmpty(count2) && ObjectUtils.isEmpty(count1)) { |
| | | if (ObjectUtils.isNotEmpty(insProduct.getManHour()) && ObjectUtils.isEmpty(count2) && ObjectUtils.isEmpty(count1)) { |
| | | AuxiliaryOutputWorkingHours auxiliaryOutputWorkingHours = new AuxiliaryOutputWorkingHours(); |
| | | if (isWithinRange) { |
| | | //在时间内就是正常上班 |
| | |
| | | auxiliaryOutputWorkingHours.setOrderNo(insOrder.getEntrustCode());//非加班委托单号 |
| | | auxiliaryOutputWorkingHours.setWorkTime(insProduct.getManHour());//非加班工时 |
| | | auxiliaryOutputWorkingHours.setAmount(1);//非加班数量 |
| | | auxiliaryOutputWorkingHours.setOutputWorkTime((ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getOvertimeWorkTime())?auxiliaryOutputWorkingHours.getOvertimeWorkTime():0)+(ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getWorkTime())?auxiliaryOutputWorkingHours.getWorkTime():0));//产量工时 |
| | | auxiliaryOutputWorkingHours.setOutputWorkTime((ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getOvertimeWorkTime()) ? auxiliaryOutputWorkingHours.getOvertimeWorkTime() : 0) + (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getWorkTime()) ? auxiliaryOutputWorkingHours.getWorkTime() : 0));//产量工时 |
| | | auxiliaryOutputWorkingHours.setManHourGroup(insProduct.getManHourGroup());//工时分组 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | auxiliaryOutputWorkingHours.setOvertimeOrderNo(insOrder.getEntrustCode());//加班委托单号 |
| | | auxiliaryOutputWorkingHours.setOvertimeWorkTime(insProduct.getManHour());//加班工时 |
| | | auxiliaryOutputWorkingHours.setOvertimeAmount(1);//加班数量 |
| | | auxiliaryOutputWorkingHours.setOutputWorkTime((ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getOvertimeWorkTime())?auxiliaryOutputWorkingHours.getOvertimeWorkTime():0)+(ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getWorkTime())?auxiliaryOutputWorkingHours.getWorkTime():0));//产量工时 |
| | | auxiliaryOutputWorkingHours.setOutputWorkTime((ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getOvertimeWorkTime()) ? auxiliaryOutputWorkingHours.getOvertimeWorkTime() : 0) + (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHours.getWorkTime()) ? auxiliaryOutputWorkingHours.getWorkTime() : 0));//产量工时 |
| | | auxiliaryOutputWorkingHours.setManHourGroup(insProduct.getManHourGroup());//工时分组 |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | |
| | | //交接 |
| | | @Override |
| | | public int upPlanUser(Integer userId, Integer orderId,String sonLaboratory) { |
| | | public int upPlanUser(Integer userId, Integer orderId, String sonLaboratory) { |
| | | InsSampleUser insSampleUser = new InsSampleUser(); |
| | | insSampleUser.setUserId(userId); |
| | | insSampleUser.setInsSampleId(orderId); |
| | |
| | | if (i % number == 0) { |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | //表格的行数 × √ ✖ ✔ |
| | | long count1 = size-(index-1)*number < number ? size-(index-1)*number + 3 : number + 3; |
| | | for (int j = 0; j <count1 ; j++) { |
| | | long count1 = size - (index - 1) * number < number ? size - (index - 1) * number + 3 : number + 3; |
| | | for (int j = 0; j < count1; j++) { |
| | | RowRenderData rowRenderData = new RowRenderData(); |
| | | RowStyle rowStyle = new RowStyle(); |
| | | rowStyle.setHeight(40); |
| | |
| | | cellRenderData.setParagraphs(paragraphRenderDataList); |
| | | cells.add(cellRenderData); |
| | | } |
| | | } |
| | | else if (j == 1) { |
| | | } else if (j == 1) { |
| | | //第二行 |
| | | if (k == 0) { |
| | | //第一列 |
| | |
| | | cellRenderData.setParagraphs(paragraphRenderDataList); |
| | | cells.add(cellRenderData); |
| | | } |
| | | } |
| | | else if (j == count1-1) { |
| | | } else if (j == count1 - 1) { |
| | | //最后一行 |
| | | if (k == 0 || k == 1) { |
| | | //前两列 |
| | |
| | | cellRenderData.setParagraphs(paragraphRenderDataList); |
| | | cells.add(cellRenderData); |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | if (k == 0) { |
| | | //第一列 |
| | | textRenderData.setText((j - 1) + ""); |
| | |
| | | if (i % 16 == 0) { |
| | | //样品数量超过16需要新增表格 |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | int count2 = sampleList.size()-(index41-1)*16 < 16 ? (int) (sampleList.size() - (index41 - 1) * 16 + 1) : 17; |
| | | int count2 = sampleList.size() - (index41 - 1) * 16 < 16 ? (int) (sampleList.size() - (index41 - 1) * 16 + 1) : 17; |
| | | //表格的行数 |
| | | for (int j = 0; j < count2; j++) { |
| | | RowRenderData rowRenderData = new RowRenderData(); |
| | |
| | | cellRenderData.setParagraphs(paragraphRenderDataList); |
| | | cells.add(cellRenderData); |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | if (k == 0) { |
| | | //第一列 |
| | | textRenderData.setText(sampleList.get(0).getModel() + "∑44"); |
| | |
| | | } catch (Exception e) { |
| | | throw new ErrorException("找不到检验人的签名"); |
| | | } |
| | | if (ObjectUtils.isEmpty(signatureUrl) || signatureUrl.equals("")) { |
| | | if (ObjectUtils.isEmpty(signatureUrl) || signatureUrl.equals("")) { |
| | | throw new ErrorException("找不到检验人的签名"); |
| | | } |
| | | //Custom custom = customMapper.selectById(user.get("company")); |
| | |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | else { |
| | | } else { |
| | | //复核不通过将把复核的负责人去掉 |
| | | Integer id = insSampleUserMapper.selectOne(Wrappers.<InsSampleUser>lambdaQuery().eq(InsSampleUser::getInsSampleId, orderId).orderByDesc(InsSampleUser::getId).last("limit 1")).getId(); |
| | | insSampleUserMapper.deleteById(id); |
| | |
| | | insProductMapper.updateById(product); |
| | | } |
| | | //如果是热循环或者是温升试验 |
| | | else if (product.getInspectionItem().equals("热循环") || product.getInspectionItem().equals("温升试验")){ |
| | | else if (product.getInspectionItem().equals("热循环") || product.getInspectionItem().equals("温升试验")) { |
| | | //查询这些项目下的其他检验项目是否全部检验 |
| | | List<InsProduct> insProductList = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, product.getInsSampleId()) |
| | |
| | | product.setInsResult(1); |
| | | } |
| | | insProductMapper.updateById(product); |
| | | } |
| | | else { |
| | | } else { |
| | | count++; |
| | | str += "<br/>" + count + ":" + product.getInspectionItem() + " " + product.getInspectionItemSubclass() + "<br/>"; |
| | | } |