| | |
| | | @Resource |
| | | private InsProductResultMapper insProductResultMapper; |
| | | |
| | | @Resource |
| | | private InsProductUserMapper insProductUserMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | public void saveInsContext(Map<String, Object> insContext) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | CompletableFuture.supplyAsync(() -> { |
| | | AtomicInteger count = new AtomicInteger(); |
| | | insContext.forEach((k, v) -> { |
| | | JSONObject jo = JSON.parseObject(JSON.toJSONString(v)); |
| | | InsProduct insProduct = new InsProduct(); |
| | |
| | | result = new InsProductResult(); |
| | | } |
| | | result.setInsProductId(Integer.parseInt(k)); |
| | | if(jo.get("insValue") != null){ |
| | | if (jo.get("insValue") != null) { |
| | | JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue"))); |
| | | List<Map<String, Object>> iv = new ArrayList<>(); |
| | | for (Object o : jsonArray) { |
| | |
| | | map.put("u", insValue.get("u")); |
| | | } |
| | | iv.add(map); |
| | | }catch (Exception e){} |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | result.setInsValue(JSON.toJSONString(iv)); |
| | | } |
| | | if(jo.get("comValue") != null){ |
| | | if (jo.get("comValue") != null) { |
| | | JSONArray jsonArray2 = JSON.parseArray(JSON.toJSONString(jo.get("comValue"))); |
| | | List<Map<String, Object>> cv = new ArrayList<>(); |
| | | for (Object o : jsonArray2) { |
| | |
| | | result.setComValue(JSON.toJSONString(cv)); |
| | | } |
| | | JSONObject resValue = JSON.parseObject(JSON.toJSONString(jo.get("resValue"))); |
| | | if(resValue.get("v")!=null){ |
| | | if (resValue.get("v") != null) { |
| | | insProduct.setLastValue(JSON.parseObject(JSON.toJSONString(resValue.get("v"))).get("v") + ""); |
| | | } |
| | | JSONObject equipValue = JSON.parseObject(JSON.toJSONString(jo.get("equipValue"))); |
| | |
| | | } |
| | | insProduct.setUpdateUser(userId); |
| | | insProductMapper.updateById(insProduct); |
| | | if (count.get() == 0) { |
| | | InsSample insSample = insSampleMapper.selectById(insProductMapper.selectById(insProduct.getId()).getInsSampleId()); |
| | | insSample.setInsState(1); |
| | | count.addAndGet(1); |
| | | insProductUserMapper.insert(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); |
| | | InsSample insSample = insSampleMapper.selectById(insProductMapper.selectById(insProduct.getId()).getInsSampleId()); |
| | | insSample.setInsState(1); |
| | | Long l = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, insSample.getId())); |
| | | Long l1 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId, insSample.getId()).isNotNull(InsProduct::getInsResult)); |
| | | if (l == l1) { |
| | | insSample.setInsState(2); |
| | | } |
| | | insSampleMapper.updateById(insSample); |
| | | }); |
| | | return null; |
| | | }).thenAccept(res -> { |
| | |
| | | samples.forEach(a -> { |
| | | Set<String> templateSet = new HashSet<>(); |
| | | getTemplateThing(set, map2, a); |
| | | a.getInsProduct().forEach(b->{ |
| | | String[] split = b.getMethod().replaceAll("]", "").replaceAll("\\[","").replaceAll("\"","").split(","); |
| | | a.getInsProduct().forEach(b -> { |
| | | String[] split = b.getMethod().replaceAll("]", "").replaceAll("\\[", "").replaceAll("\"", "").split(","); |
| | | standardMethod.addAll(Arrays.asList(split)); |
| | | if(b.getInsProductResult()!=null){ |
| | | if(b.getInsProductResult().getEquipValue()!=null&& !Objects.equals(b.getInsProductResult().getEquipValue(), "")){ |
| | | if (b.getInsProductResult() != null) { |
| | | if (b.getInsProductResult().getEquipValue() != null && !Objects.equals(b.getInsProductResult().getEquipValue(), "")) { |
| | | deviceSet.add(b.getInsProductResult().getEquipValue()); |
| | | } |
| | | } |
| | |
| | | templateSet.add(JSON.toJSONString(b.getTemplate())); |
| | | }); |
| | | AtomicInteger index = new AtomicInteger(); |
| | | templateSet.forEach(tem->{ |
| | | templateSet.forEach(tem -> { |
| | | Set<Integer> set2 = new HashSet<>(); |
| | | List<RowRenderData> rows = new ArrayList<>(); |
| | | List<TextRenderData> text = new ArrayList<>(); |
| | |
| | | if ("检验子项".equals(JSON.parseObject(JSON.toJSONString(v.get("ps"))).get("value") + "")) { |
| | | int count2 = 0; |
| | | for (InsProduct p : a.getInsProduct()) { |
| | | if(v.get("v").equals(p.getInspectionItemSubclass())){ |
| | | pMap.put(jo1.get("r")+"", p); |
| | | if (v.get("v").equals(p.getInspectionItemSubclass())) { |
| | | pMap.put(jo1.get("r") + "", p); |
| | | break; |
| | | }else{ |
| | | } else { |
| | | count2++; |
| | | } |
| | | } |
| | | if(count2 == a.getInsProduct().size()){ |
| | | delRSet.add(jo1.get("r")+""); |
| | | if (count2 == a.getInsProduct().size()) { |
| | | delRSet.add(jo1.get("r") + ""); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | JSONObject v = JSON.parseObject(JSON.toJSONString(jo1.get("v"))); |
| | | InsProduct p = pMap.get(jo1.get("r") + ""); |
| | | if (p!=null && v.get("ps") != null) { |
| | | if (p != null && v.get("ps") != null) { |
| | | String value = JSON.parseObject(JSON.toJSONString(v.get("ps"))).get("value") + ""; |
| | | if (value.equals("要求值")) { |
| | | textRenderData.setText(p.getAsk()); |
| | |
| | | } else { |
| | | textRenderData.setText(v.get("v") == null ? "" : v.get("v") + ""); |
| | | } |
| | | } else if (p==null && v.get("ps") != null) { |
| | | } else if (p == null && v.get("ps") != null) { |
| | | String value = JSON.parseObject(JSON.toJSONString(v.get("ps"))).get("value") + ""; |
| | | p = pMap.get(pMap.keySet().iterator().next()); |
| | | if (value.equals("最终值")) { |
| | |
| | | for (String s : standardMethod) { |
| | | standardMethod2.append("、").append(s); |
| | | } |
| | | standardMethod2.replace(0, 1,""); |
| | | tables.forEach(table->{ |
| | | standardMethod2.replace(0, 1, ""); |
| | | tables.forEach(table -> { |
| | | table.put("tableSize", tables.size() + 1); |
| | | }); |
| | | List<Map<String, String>> deviceList = insOrderMapper.selectDeviceList(deviceSet); |
| | |
| | | codeStr.put("发放日期", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | String codePath; |
| | | try { |
| | | codePath = new MatrixToImageWriter().code(JackSonUtil.marshal(codeStr).replaceAll("\\{","") |
| | | .replaceAll("}","").replaceAll(",","").replaceAll("\"",""), twoCode); |
| | | codePath = new MatrixToImageWriter().code(JackSonUtil.marshal(codeStr).replaceAll("\\{", "") |
| | | .replaceAll("}", "").replaceAll(",", "").replaceAll("\"", ""), twoCode); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | Map<String, Object> style = new HashMap<>(); |
| | | style.put("rowlen", config.get("rowlen")); |
| | | style.put("columnlen", config.get("columnlen")); |
| | | // int r = -1; |
| | | /*if (BeanUtil.isNotEmpty(cellData)) { |
| | | /*int r = -1; |
| | | if (BeanUtil.isNotEmpty(cellData)) { |
| | | for (JSONObject o : cellData) { |
| | | JSONObject v = JSON.parseObject(JSON.toJSONString(o.get("v"))); |
| | | tableData.add(o); |