| | |
| | | Integer isCheck = insOrderPlanDTO.getIsCheck(); |
| | | insOrderPlanDTO.setIsCheck(null); |
| | | String sonLaboratory = insOrderPlanDTO.getSonLaboratory();//试验室 |
| | | // 数据置空,防止反射生成重复数据 |
| | | String materialProp = insOrderPlanDTO.getMaterialProp(); |
| | | insOrderPlanDTO.setMaterialProp(null); |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, |
| | | QueryWrappers.queryWrappers(insOrderPlanDTO), |
| | | userName, |
| | | userId, |
| | | sonLaboratory, |
| | | laboratory, |
| | | isCheck); |
| | | isCheck, |
| | | materialProp); |
| | | return insOrderPage; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Map<String,Object> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | public Map<String, Object> checkSubmitPlan(Integer orderId, String laboratory) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<String> collect = new ArrayList<>(); |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | |
| | | //查询ifs拆分订单是否有已下单但是未检完的单子 |
| | | long count = 0L; |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | if(Objects.nonNull(insOrder.getIfsInventoryId())){ |
| | | if (Objects.nonNull(insOrder.getIfsInventoryId())) { |
| | | IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectById(insOrder.getIfsInventoryId()); |
| | | //过滤出不合格或未提交的单子 |
| | | count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(),one.getLineNo(),one.getReleaseNo(),one.getReceiptNo(),one.getOrderNo()) |
| | | count = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo()) |
| | | .stream() |
| | | .filter(f->(Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(),orderId)) && (Objects.isNull(f.getInsResult()) || 0==f.getInsResult())).count(); |
| | | .filter(f -> (Objects.nonNull(f.getInsOrderId()) && !Objects.equals(f.getInsOrderId(), orderId)) && (Objects.isNull(f.getInsResult()) || 0 == f.getInsResult())).count(); |
| | | } |
| | | map.put("errorMsg",collect); |
| | | map.put("unInsOrderCount",count); |
| | | map.put("errorMsg", collect); |
| | | map.put("unInsOrderCount", count); |
| | | return map; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 查询模板内容 |
| | | * |
| | | * @param order |
| | | * @param insProducts |
| | | */ |
| | |
| | | |
| | | /** |
| | | * todo: 原始记录模板清除没有使用的检验项(暂时有bug无法使用) |
| | | * |
| | | * @param sheet |
| | | * @param itemNameList |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 坐标拼接 |
| | | * |
| | | * @param r 横坐标 |
| | | * @param c 纵坐标 |
| | | * @return |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode,Boolean registerInsResults) { |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser, String entrustCode, Boolean registerInsResults) { |
| | | InsOrder order = insOrderMapper.selectById(orderId); |
| | | // 1. 判断是否有重复编号, 有重复编号做提醒 |
| | | Long codeCount = insOrderMapper.selectCount(Wrappers.<InsOrder>lambdaQuery() |
| | |
| | | int count = 0; |
| | | for (InsProduct product : insProducts) { |
| | | count++; |
| | | str += (count != 0 ? "\n" : "") + count + ":" + |
| | | str += (count != 0 ? "\n" : "") + count + ":" + |
| | | product.getInspectionItemClass() + " " + |
| | | product.getInspectionItem() + " " + |
| | | product.getInspectionItemSubclass(); |
| | |
| | | // 登记检验结果 |
| | | // 判断是否有不合格, 有不合格不能移库 |
| | | // todo: ifs移库 |
| | | insReportService.isRawMaterial(order,registerInsResults,false); |
| | | insReportService.isRawMaterial(order, registerInsResults, false); |
| | | |
| | | // 15 判断当前样品是否为原材料, 原材料需要进行数据分析, 判断之前10条数据同一个供应商, 同一个检验项的偏差是否超过10% |
| | | // 查询ifs信息获取获取前10个供应商一样的, 检验项一样信息 |
| | |
| | | |
| | | /** |
| | | * *****添加分析数据****** |
| | | * |
| | | * @param productList |
| | | * @param ifsInventoryQuantity |
| | | * @param order |
| | |
| | | |
| | | /** |
| | | * *****计算偏差**** |
| | | * |
| | | * @param data |
| | | * @param targetStr |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * *****计算偏差**** |
| | | * |
| | | * @param targetStr |
| | | * @return |
| | | */ |
| | | public static double isDeviationOverTenPercentByAsked(String asked, String targetStr) { |
| | | if(!isNumeric(asked)) return 0; |
| | | if (!isNumeric(asked)) return 0; |
| | | double average = Double.parseDouble(asked); |
| | | |
| | | double target = Double.parseDouble(targetStr); |
| | |
| | | |
| | | /** |
| | | * ******原始记录模板复制***** |
| | | * |
| | | * @param orderId |
| | | * @param ids |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 检验任务复核 |
| | | * |
| | | * @param orderId |
| | | * @param laboratory |
| | | * @param type |
| | |
| | | |
| | | /** |
| | | * 生成报告 |
| | | * |
| | | * @param orderId |
| | | */ |
| | | private void generateReport(Integer orderId) { |
| | |
| | | |
| | | /** |
| | | * 电缆配置, 查看配置标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 原材料查看标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查看重复标识 |
| | | * |
| | | * @param id |
| | | * @param laboratory |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 新增不合格复测内容 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | |
| | | /** |
| | | * 查询进货原始记录 |
| | | * |
| | | * @param insOrderId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 保存原材料进货验证 |
| | | * |
| | | * @param factoryVerify |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 设置表格样式 |
| | | * |
| | | * @param max 标识最大个数 |
| | | * @return |
| | | */ |
| | | private TableStyle setTableStyle(int max){ |
| | | private TableStyle setTableStyle(int max) { |
| | | //设置样式 |
| | | TableStyle tableStyle = new TableStyle(); |
| | | if(max<=5){ |
| | | if (max <= 5) { |
| | | for (int i = 1; i <= max; i++) { |
| | | // 根据检验结果个数修改长度 |
| | | switch (i) { |
| | |
| | | |
| | | /** |
| | | * 处理有电缆颜色标识的检测项 |
| | | * @param cableTags 电缆颜色标识 |
| | | * @param collect 检测项列表 |
| | | * |
| | | * @param cableTags 电缆颜色标识 |
| | | * @param collect 检测项列表 |
| | | * @param startIndex 起始下标 |
| | | * @param endIndex 结束下标 |
| | | * @return |
| | | */ |
| | | private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags,Map<String, List<SampleProductExportDto>> collect,int startIndex,int endIndex){ |
| | | private List<SampleProductExportDto> transformSampleProduct(List<String> cableTags, Map<String, List<SampleProductExportDto>> collect, int startIndex, int endIndex) { |
| | | List<SampleProductExportDto> sampleProductExportDtos = new ArrayList<>(); |
| | | for (String s : collect.keySet()) { |
| | | List<String> lastValueList = new ArrayList<>(); |
| | | SampleProductExportDto dto = new SampleProductExportDto(); |
| | | BeanUtil.copyProperties(collect.get(s).get(0),dto); |
| | | BeanUtil.copyProperties(collect.get(s).get(0), dto); |
| | | Set<String> tellSet = new HashSet<>(); |
| | | for (int i = startIndex; i < endIndex; i++) { |
| | | String cableTag = cableTags.get(i); |
| | | for (SampleProductExportDto sDto : collect.get(s)) { |
| | | tellSet.add(sDto.getTell()); |
| | | if(sDto.getCableTag().equals(cableTag)){ |
| | | if (sDto.getCableTag().equals(cableTag)) { |
| | | lastValueList.add(sDto.getLastValue()); |
| | | } |
| | | } |
| | | } |
| | | //切割电缆配置项 |
| | | dto.setTell(String.join("\n",tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()))); |
| | | dto.setTell(String.join("\n", tellSet.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList()))); |
| | | dto.setLastValueList(lastValueList); |
| | | sampleProductExportDtos.add(dto); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 检测项排序 |
| | | * |
| | | * @param sourceMap |
| | | * @param targetMap |
| | | */ |
| | | private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap,Map<String, List<SampleProductExportDto>> targetMap){ |
| | | private void sortSampleProduct(Map<String, List<SampleProductExportDto>> sourceMap, Map<String, List<SampleProductExportDto>> targetMap) { |
| | | List<Map.Entry<String, List<SampleProductExportDto>>> entries = new ArrayList<>(sourceMap.entrySet()); |
| | | entries.sort(Comparator.comparingInt(o -> (o.getValue().get(0).getSort() == null ? 0 : o.getValue().get(0).getSort()))); |
| | | for (Map.Entry<String, List<SampleProductExportDto>> entry : entries) { |
| | |
| | | |
| | | /** |
| | | * 小报告生成 |
| | | * |
| | | * @param orderId |
| | | * @param insOrder |
| | | * @param insSamples |
| | |
| | | //查询零件属性 |
| | | IfsPartPropsRecord ifsPartPropsRecord = ifsPartPropsRecordMapper.selectOne(Wrappers.<IfsPartPropsRecord>lambdaQuery() |
| | | .eq(IfsPartPropsRecord::getIfsInventoryId, ifsInventoryQuantity.getId())); |
| | | if(Objects.nonNull(ifsPartPropsRecord)){ |
| | | if (Objects.nonNull(ifsPartPropsRecord)) { |
| | | enterFactoryReport.setOuterColor(ifsPartPropsRecord.getOuterColor()); |
| | | } |
| | | enterFactoryReport.setQtyArrived(ifsInventoryQuantity.getQtyArrived() == null ? "" : |
| | |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | List<TextRenderData> text = new ArrayList<>(); |
| | | RowRenderData rowRenderData = null; |
| | | List<Map<String,Object>> cableTagEnclosureTables = new ArrayList<>(); |
| | | List<Map<String, Object>> cableTagEnclosureTables = new ArrayList<>(); |
| | | |
| | | // 查询检验内容 |
| | | List<SampleProductExportDto> sampleProductDto2s = insOrderMapper.selectSampleBySampleId(insSamples.stream() |
| | |
| | | Integer max = insSamples.stream().mapToInt(InsSample::getQuantity).sum(); |
| | | TableRenderData tableRenderData = new TableRenderData(); |
| | | String templateName; |
| | | if(StringUtils.equals(OrderType.WG.getValue(),ifsInventoryQuantity.getOrderType())){ |
| | | if (StringUtils.equals(OrderType.WG.getValue(), ifsInventoryQuantity.getOrderType())) { |
| | | //过滤不判定的检测项 |
| | | List<SampleProductExportDto> filterItems = sampleProductDto2s.stream().filter(f -> f.getInsResult() != 3).collect(Collectors.toList()); |
| | | int maxCableTag = 5;//单个表格,电缆颜色标识最大个数 |
| | | templateName = "/static/small-wg-report-template.docx"; |
| | | //查询检验单消息 |
| | | InsSampleUserVO insSampleUser = insSampleUserMapper.selectUserNameByOrderId(orderId); |
| | | if(Objects.nonNull(insSampleUser)){ |
| | | if (Objects.nonNull(insSampleUser)) { |
| | | enterFactoryReport.setPartDesc(insSampleUser.getModel()); |
| | | enterFactoryReport.setInspector(insSampleUser.getInspector()); |
| | | enterFactoryReport.setInspectDate(insSampleUser.getInspectDate()); |
| | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | List<String> cableTags = insOrderMapper.selectSampleCableTag(insSample.getId()); |
| | | max = Math.max(cableTags.size(),1); |
| | | max = Math.max(cableTags.size(), 1); |
| | | //处理电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> tempMap = new HashMap<>(); |
| | | Map<String, List<SampleProductExportDto>> tempMap2 = new HashMap<>(); |
| | |
| | | List<SampleProductExportDto> sampleProductExportDtos2; |
| | | //处理电缆配置项 |
| | | Map<String, List<SampleProductExportDto>> collect = listMap2.get(key).stream().collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItemSubclass)); |
| | | if(cableTags.size()>maxCableTag){ |
| | | sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,maxCableTag); |
| | | sampleProductExportDtos2 = transformSampleProduct(cableTags,collect,maxCableTag,cableTags.size()); |
| | | tempMap2.put(key,sampleProductExportDtos2); |
| | | }else{ |
| | | sampleProductExportDtos = transformSampleProduct(cableTags,collect,0,cableTags.size()); |
| | | if (cableTags.size() > maxCableTag) { |
| | | sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, maxCableTag); |
| | | sampleProductExportDtos2 = transformSampleProduct(cableTags, collect, maxCableTag, cableTags.size()); |
| | | tempMap2.put(key, sampleProductExportDtos2); |
| | | } else { |
| | | sampleProductExportDtos = transformSampleProduct(cableTags, collect, 0, cableTags.size()); |
| | | } |
| | | cableTagItem.put(key,sampleProductExportDtos); |
| | | cableTagItem.put(key, sampleProductExportDtos); |
| | | } |
| | | //处理非电缆配置检测项 |
| | | Map<String, List<SampleProductExportDto>> listMap = filterItems.stream() |
| | | .filter(f -> StringUtils.isBlank(f.getCableTag()) && StringUtils.isNotBlank(f.getInspectionItem())) |
| | | .collect(Collectors.groupingBy(s->s.getInspectionItem()+"&")); |
| | | .collect(Collectors.groupingBy(s -> s.getInspectionItem() + "&")); |
| | | //合并检测项列表 |
| | | tempMap.putAll(cableTagItem); |
| | | tempMap.putAll(listMap); |
| | | sortSampleProduct(tempMap,totalItem); |
| | | int tagNum = Math.min(max,maxCableTag); |
| | | List<String> tagList = cableTags.isEmpty()?new ArrayList<>():cableTags.subList(0,tagNum); |
| | | handlerSampleItems(OrderType.WG.getValue(),totalItem,finalIndex,sampleList,tagNum,text,rows,rowRenderData,resultCh,tagList,true); |
| | | sortSampleProduct(tempMap, totalItem); |
| | | int tagNum = Math.min(max, maxCableTag); |
| | | List<String> tagList = cableTags.isEmpty() ? new ArrayList<>() : cableTags.subList(0, tagNum); |
| | | handlerSampleItems(OrderType.WG.getValue(), totalItem, finalIndex, sampleList, tagNum, text, rows, rowRenderData, resultCh, tagList, true); |
| | | |
| | | if(CollectionUtil.isNotEmpty(tempMap2)){ |
| | | sortSampleProduct(tempMap2,cableTagEnclosureItem); |
| | | if (CollectionUtil.isNotEmpty(tempMap2)) { |
| | | sortSampleProduct(tempMap2, cableTagEnclosureItem); |
| | | //生成附件电缆表格 |
| | | TableRenderData tableRenderData2 = new TableRenderData(); |
| | | List<String> newCableTags = cableTags.subList(maxCableTag,cableTags.size()); |
| | | List<String> newCableTags = cableTags.subList(maxCableTag, cableTags.size()); |
| | | AtomicInteger finalIndex2 = new AtomicInteger(1); |
| | | List<TextRenderData> newText = new ArrayList<TextRenderData>(); |
| | | List<RowRenderData> newRows = new ArrayList<>(); |
| | | RowRenderData newRowRenderData = null; |
| | | handlerSampleItems(OrderType.WG.getValue(),cableTagEnclosureItem,finalIndex2, new ArrayList<>(),newCableTags.size(),newText,newRows,newRowRenderData,resultCh,newCableTags,true); |
| | | handlerSampleItems(OrderType.WG.getValue(), cableTagEnclosureItem, finalIndex2, new ArrayList<>(), newCableTags.size(), newText, newRows, newRowRenderData, resultCh, newCableTags, true); |
| | | tableRenderData2.setRows(newRows); |
| | | tableRenderData2.setTableStyle(setTableStyle(newCableTags.size())); |
| | | HashMap<String, Object> tableMap = new HashMap<>(); |
| | | tableMap.put("enclosureTable",tableRenderData2); |
| | | tableMap.put("enclosureTable", tableRenderData2); |
| | | tableMap.put("resultCh", resultCh); |
| | | tableMap.put("writeUrl", null); |
| | | tableMap.put("examineUrl", null); |
| | |
| | | resultCh.set("本产品符合相关标准要求,经检验合格准予出厂(盖章有效)"); |
| | | } |
| | | |
| | | }else{ |
| | | } else { |
| | | templateName = "/static/small-report-template.docx"; |
| | | // 转成Mpa进行排序 |
| | | Map<String, List<SampleProductExportDto>> sortedMap = sampleProductDto2s.stream() |
| | |
| | | .collect(Collectors.groupingBy(SampleProductExportDto::getInspectionItem)); |
| | | // // 创建一个 LinkedHashMap 来保持插入顺序 |
| | | Map<String, List<SampleProductExportDto>> item = new LinkedHashMap<>(); |
| | | sortSampleProduct(sortedMap,item); |
| | | sortSampleProduct(sortedMap, item); |
| | | |
| | | |
| | | AtomicInteger finalIndex = new AtomicInteger(1); |
| | | handlerSampleItems(OrderType.RAW.getValue(), item,finalIndex,sampleList,max,text,rows,rowRenderData,resultCh,null,true); |
| | | handlerSampleItems(OrderType.RAW.getValue(), item, finalIndex, sampleList, max, text, rows, rowRenderData, resultCh, null, true); |
| | | tableRenderData.setRows(rows); |
| | | tableRenderData.setTableStyle(setTableStyle(max)); |
| | | |
| | |
| | | put("standardMethod", standardMethod2.toString().equals("null") ? "" : standardMethod2); |
| | | put("orderType", orderType); |
| | | put("table", tableRenderData); |
| | | put("enclosureTables", cableTagEnclosureTables.isEmpty()?null:cableTagEnclosureTables); |
| | | put("enclosureTables", cableTagEnclosureTables.isEmpty() ? null : cableTagEnclosureTables); |
| | | put("resultCh", resultCh); |
| | | put("writeUrl", null); |
| | | put("examineUrl", null); |
| | |
| | | |
| | | /** |
| | | * 处理常规检测项 |
| | | * |
| | | * @param item |
| | | * @param finalIndex |
| | | * @param sampleList |
| | |
| | | * @param rowRenderData |
| | | * @param resultCh |
| | | */ |
| | | private static void handlerSampleItems(String orderType,Map<String, List<SampleProductExportDto>> item,AtomicInteger finalIndex,List<SampleProductExportDto> sampleList,Integer max,List<TextRenderData> text,List<RowRenderData> rows,RowRenderData rowRenderData,AtomicReference<String> resultCh,List<String> cableTagList,Boolean hasAddHead ){ |
| | | private static void handlerSampleItems(String orderType, Map<String, List<SampleProductExportDto>> item, AtomicInteger finalIndex, List<SampleProductExportDto> sampleList, Integer max, List<TextRenderData> text, List<RowRenderData> rows, RowRenderData rowRenderData, AtomicReference<String> resultCh, List<String> cableTagList, Boolean hasAddHead) { |
| | | item.forEach((s, sampleProductDtoInside) -> { |
| | | // 添加检验项 |
| | | SampleProductExportDto dto2 = new SampleProductExportDto(); |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |
| | |
| | | String productName = productDto2.getInspectionItemClass() + productDto2.getInspectionItem() + productDto2.getInspectionItemSubclass() + productDto2.getCableTag(); |
| | | if (map.containsKey(productName)) { |
| | | // 如果名称已经存在,添加 lastValue 值到 lastValueList 列表 |
| | | if(CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(map.get(productName).getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | map.get(productName) |
| | | .getLastValueList() |
| | | .add(productDto2.getLastValue()); |
| | |
| | | .add(productDto2.getInsResult()); |
| | | } else { |
| | | // 如果名称不存在,直接放入 map |
| | | if(CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(),orderType)){ |
| | | if (CollectionUtil.isEmpty(productDto2.getLastValueList()) || StringUtils.equals(OrderType.RAW.getValue(), orderType)) { |
| | | productDto2.setLastValueList(new ArrayList<>()); // 检验内容 |
| | | productDto2.getLastValueList().add(productDto2.getLastValue()); |
| | | } |
| | |
| | | }); |
| | | |
| | | // 添加小报告表头 |
| | | if(hasAddHead){ |
| | | text = addSmallHead(text, max, rows,cableTagList); |
| | | if (hasAddHead) { |
| | | text = addSmallHead(text, max, rows, cableTagList); |
| | | } |
| | | |
| | | // 中间检测值添加 |
| | |
| | | // 检验项目 |
| | | TextRenderData middleRenderData2 = new TextRenderData(); |
| | | String[] split = sample.getInspectionName().split("&"); |
| | | String itemName = split.length>0?split[0]:sample.getInspectionName(); |
| | | middleRenderData2.setText(itemName+"∑"+itemName+i+"_"+finalIndex); |
| | | String itemName = split.length > 0 ? split[0] : sample.getInspectionName(); |
| | | middleRenderData2.setText(itemName + "∑" + itemName + i + "_" + finalIndex); |
| | | Style middleStyle2 = new Style(); |
| | | middleStyle2.setFontFamily("宋体"); |
| | | middleStyle2.setColor("000000"); |
| | |
| | | TextRenderData middleRenderData6 = new TextRenderData(); |
| | | middleRenderData6.setText((StringUtils.isNotEmpty(sample.getLastValue()) ? |
| | | sample.getLastValue() : "") |
| | | + "∑" + (finalIndex.get() +"_"+ i)); |
| | | + "∑" + (finalIndex.get() + "_" + i)); |
| | | Style middleStyle6 = new Style(); |
| | | middleStyle6.setFontFamily("宋体"); |
| | | middleStyle6.setColor("000000"); |
| | |
| | | |
| | | /** |
| | | * 添加小报告表头 |
| | | * |
| | | * @param text |
| | | * @param max |
| | | * @param rows |
| | | * @return |
| | | */ |
| | | private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows,List<String> cableTagList) { |
| | | private static List<TextRenderData> addSmallHead(List<TextRenderData> text, Integer max, List<RowRenderData> rows, List<String> cableTagList) { |
| | | RowRenderData rowRenderData; |
| | | // // 头 |
| | | TextRenderData headRenderData1 = new TextRenderData(); |
| | |
| | | text = new ArrayList<>(); |
| | | } |
| | | //如果有电缆颜色,生成颜色标识行 |
| | | if(CollectionUtil.isNotEmpty(cableTagList)){ |
| | | if (CollectionUtil.isNotEmpty(cableTagList)) { |
| | | TextRenderData tagRenderData1 = new TextRenderData(); |
| | | tagRenderData1.setText(""); |
| | | Style tagStyle1 = new Style(); |
| | |
| | | |
| | | /** |
| | | * 创建大报告 |
| | | * |
| | | * @param orderId |
| | | * @param insOrder |
| | | * @param |
| | |
| | | |
| | | /** |
| | | * 调整高度 |
| | | * |
| | | * @param row |
| | | * @param rowHeight |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 添加报告表头 |
| | | * |
| | | * @param sample |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | | * @param max |
| | | * @param cableTags 线芯颜色 |
| | | * @param cableTags 线芯颜色 |
| | | */ |
| | | private static void addHead(SampleProductDto sample, List<TextRenderData> text, RowRenderData rowRenderData, List<RowRenderData> rows, int max, List<String> cableTags) { |
| | | // 第一行 |
| | |
| | | |
| | | /** |
| | | * 添加检测值 |
| | | * @param a 当前样品 |
| | | * |
| | | * @param a 当前样品 |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | | * @param max 检验数量 |
| | | * @param max 检验数量 |
| | | * @param resultChList 不符合信息中文 |
| | | * @param resultEhList 不符合信息英文 |
| | | * @param insSamples |
| | | * @param cableTags 线芯颜色 |
| | | * @param isOneSample 判断是否是只有一个样品 |
| | | * @param cableTags 线芯颜色 |
| | | * @param isOneSample 判断是否是只有一个样品 |
| | | */ |
| | | private int addTestValue(SampleProductDto a, |
| | | List<TextRenderData> text, |
| | |
| | | |
| | | /** |
| | | * 添加报告结论中英文 |
| | | * |
| | | * @param sample |
| | | * @param itemCh |
| | | * @param itemEn |
| | |
| | | |
| | | /** |
| | | * 格式化修改检验项 |
| | | * |
| | | * @param sampleProductDto2s |
| | | */ |
| | | private void formatProducts(List<SampleProductExportDto> sampleProductDto2s) { |
| | |
| | | |
| | | /** |
| | | * 添加结尾 |
| | | * |
| | | * @param text |
| | | * @param rowRenderData |
| | | * @param rows |
| | |
| | | |
| | | /** |
| | | * 判断当前内容是否是科学计数法 |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改要求描述的科学计数法 |
| | | * |
| | | * @param input |
| | | */ |
| | | public static String convertToScientificNotation(String input) { |
| | |
| | | |
| | | /** |
| | | * 展示成科学计数法 |
| | | * |
| | | * @param number |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据要求描述保留结果小数点位数 |
| | | * |
| | | * @param reference |
| | | * @param value |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 保留位数, 如果等于0 返回找到的一个非0位数 |
| | | * |
| | | * @param number 当前数字 |
| | | * @param scale 原本保留的位数 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * *****保存元此阿里进货验证原始记录***** |
| | | * @param insOrderId 订单Id |
| | | * @param examineUserId 复核人Id |
| | | * @param writeUserId 检验员Id |
| | | * |
| | | * @param insOrderId 订单Id |
| | | * @param examineUserId 复核人Id |
| | | * @param writeUserId 检验员Id |
| | | */ |
| | | private void reportFactoryVerify(Integer insOrderId, Integer examineUserId, Integer writeUserId) { |
| | | // 查询进货验证原始记录 |
| | |
| | | |
| | | /** |
| | | * ***格式化进厂验证内容**** |
| | | * |
| | | * @param basicType |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * ***word转换pdf*** |
| | | * |
| | | * @param path |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * *****修改成品抽样状态****** |
| | | * |
| | | * @param insSamples |
| | | * @param order |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 添加工时 |
| | | * |
| | | * @param userId |
| | | * @param insProduct |
| | | * @param insOrder |