| | |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.MatrixToImageWriter; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import com.yuanchu.mom.utils.RedisUtil; |
| | | import com.yuanchu.mom.utils.*; |
| | | import com.yuanchu.mom.vo.*; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | * æ£éªä»»å¡-ä¸å¡å®ç°å± |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class InsOrderPlanServiceImpl extends ServiceImpl<InsOrderMapper, InsOrder> implements InsOrderPlanService { |
| | | |
| | | @Resource |
| | |
| | | AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper; |
| | | |
| | | @Resource |
| | | AuxiliaryOutputWorkingHoursService auxiliaryOutputWorkingHoursService; |
| | | QYWXApi qywxApi; |
| | | |
| | | @Resource |
| | | private InformationNotificationService informationNotificationService; |
| | |
| | | insProductResultMapper.deleteById(insProductResultss.get(i)); |
| | | } |
| | | } |
| | | //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"))); |
| | |
| | | result.setUpdateTime(LocalDateTime.now()); |
| | | insProductResultMapper.updateById(result); |
| | | } |
| | | |
| | | /*妿æ¯ç¬¬ä¸æ¬¡éæ©è®¾å¤ä¿¡æ¯,ä¸è¿æå
¶ä½æ ·å乿åä¸ä¸ªç»éªé¡¹ç®,é£ä¹æææ ·åç该项ç®é½ç¨è¿ä¸ªè®¾å¤ä¿¡æ¯*/ |
| | | //å
æ¥è¯¢æ¯å¦è¿æå
¶ä½æ ·å |
| | | |
| | | /*//å
æ¥è¯¢æ¯å¦è¿æå
¶ä½æ ·å |
| | | 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::getStandardMethodListId, product.getStandardMethodListId()) |
| | | .eq(InsProduct::getInsBushId, product.getInsBushId()) |
| | | .eq(InsProduct::getInsFibersId, product.getInsFibersId()) |
| | | .eq(InsProduct::getInsFiberId, product.getInsFiberId()) |
| | | ); |
| | | .eq(InsProduct::getInsFiberId, product.getInsFiberId())); |
| | | if (ObjectUtils.isNotEmpty(product1)) { |
| | | //妿åå¨é¡¹ç®,æ¥è¯¢æ¯å¦æè¡¨ |
| | | InsProductResult productResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery() |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | }*/ |
| | | insProduct.setUpdateUser(userId); |
| | | insProductMapper.updateById(insProduct); |
| | | insProductUserMapper.insert(new InsProductUser(null, userId, LocalDateTime.now(), insProduct.getId())); |
| | | |
| | | insProduct = insProductMapper.selectById(insProduct); |
| | | |
| | | /*çæäº§éå·¥æ¶*/ |
| | | //æ¥è¯¢æ£éªåä¿¡æ¯ |
| | | InsOrder insOrder = insOrderMapper.selectById(insSampleMapper.selectById(insProduct.getInsSampleId()).getInsOrderId()); |
| | | //æ ¡éªå¦æè¿ä¸ªäººè¿ä¸ªæ£æµé¡¹ç®å·²ç»æ·»å è¿äºåä¸éè¦åæ°å¢ |
| | |
| | | auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//ææ |
| | | auxiliaryOutputWorkingHours.setWeek(String.valueOf(DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))));//卿¬¡ |
| | | auxiliaryOutputWorkingHours.setCheck(userId);//æ£æµäºº |
| | | } else { |
| | | } |
| | | else { |
| | | //å ç |
| | | auxiliaryOutputWorkingHours.setInspectionItem(insProduct.getInspectionItem());//æ£æµç¶é¡¹ |
| | | auxiliaryOutputWorkingHours.setInspectionItemSubclass(insProduct.getInspectionItemSubclass());//æ£æµå项 |
| | |
| | | auxiliaryOutputWorkingHours.setCheck(userId);//æ£æµäºº |
| | | } |
| | | try { |
| | | if (CollectionUtils.isEmpty(insProductResultss) && !result.getInsValue().equals("[]") || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getInsValue().equals(result.getInsValue()) && !insProductResultss.get(0).getInsValue().equals("[]"))) { |
| | | //è¿ä¸ªæ£éªé¡¹ç®è¿æ²¡æå¡«åè¿æ£éªå¼ä¸è¿æ¬¡è¿ä¸ªæ£éªé¡¹ç®å¡«åçæ£éªå¼ä¸ä¸ºç©º |
| | | if (CollectionUtils.isEmpty(insProductResultss) && jo.get("insValue") != null |
| | | //è¿ä¸ªæ£éªé¡¹ç®è¿æ²¡æå¡«åè¿æ£éªå¼ä¸è¿æ¬¡è¿ä¸ªæ£éªé¡¹ç®å¡«åç计ç®å¼ä¸ä¸ºç©ºä½æ¯æ£éªå¼ä¸ºç©º |
| | | || CollectionUtils.isEmpty(insProductResultss) && jo.get("insValue") == null && jo.get("comValue") != null |
| | | //è¿ä¸ªæ£éªé¡¹ç®æå¡«åè¿æ£éªå¼ä¸è¿æ¬¡å¡«åçæ£éªå¼ååæ¥çæ£éªå¼ä¸ç¸ç,ä¸è¿æ¬¡çæ£éªå¼ä¸çäºç©º |
| | | || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getInsValue().equals(result.getInsValue()) && jo.get("insValue") != null) |
| | | //è¿ä¸ªæ£éªé¡¹ç®æå¡«åè¿æ£éªå¼ä¸è¿æ¬¡å¡«åç计ç®å¼å忥ç计ç®å¼ä¸ç¸ç,ä¸è¿æ¬¡ç计ç®å¼ä¸çäºç©º,ä¸è¿æ¬¡çæ£éªå¼çäºç©º |
| | | || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getComValue().equals(result.getComValue()) && jo.get("insValue") == null && jo.get("comValue") != null)) { |
| | | auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours); |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | .ne(InsProduct::getInsResult, 2) |
| | | )); |
| | | if (l == l1) { |
| | | //妿ææé¡¹ç®é½æç»è®º,é£ä¹è¯¥æ ·åç¶æå·²æ£ |
| | | insSample.setInsState(2); |
| | | } |
| | | insSampleMapper.updateById(insSample); |
| | |
| | | .or() |
| | | .eq(InsProduct::getInsResult, 2) |
| | | ) |
| | | //.isNull(InsProduct::getInsResult) |
| | | .eq(InsProduct::getSonLaboratory, insProduct.getSonLaboratory()) |
| | | .eq(InsProduct::getState, 1)); |
| | | if (count == 0) { |
| | |
| | | List<TableRenderData> tables1 = new ArrayList<>(); |
| | | tableRenderData.setRows(new ArrayList<>()); |
| | | int totalHeight = 0; |
| | | int pageHeightLimit = 500; // å设æ¯é¡µçé«åº¦éå¶ä¸º500åä½ |
| | | int pageHeightLimit = 450; // å设æ¯é¡µçé«åº¦éå¶ä¸º500åä½ |
| | | int rowHeight = 0; |
| | | List<RowRenderData> firstTwoRows = new ArrayList<>(); // ä¿åå两è¡ä»¥ä¾¿å¤å¶å°æ°è¡¨æ ¼ |
| | | List<RowRenderData> endRows = new ArrayList<>(); // ä¿åå两è¡ä»¥ä¾¿å¤å¶å°æ°è¡¨æ ¼ |
| | | List<RowRenderData> endRows = new ArrayList<>(); // ä¿åæåä¸è¡å¤æ³¨ä»¥ä¾¿å¤å¶å°æ°è¡¨æ ¼ |
| | | // ä¿åå两è¡ä»¥ä¾¿å¤å¶å°æ°è¡¨æ ¼ |
| | | if (rows.size() >= 3) { |
| | | firstTwoRows.add(rows.get(0)); |
| | |
| | | .set(InsOrderState::getInsTime, LocalDateTime.now()) |
| | | .set(InsOrderState::getInsState, 3) |
| | | .set(InsOrderState::getVerifyUser, verifyUser)); |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | InformationNotification info = new InformationNotification(); |
| | | info.setCreateUser(insProductMapper.selectUserById(userId).get("name")); |
| | | info.setMessageType("2"); |
| | | info.setTheme("夿 ¸éç¥"); |
| | | info.setContent("æ¨æä¸æ¡æ£éªä»»å¡å¾
夿 ¸æ¶æ¯"); |
| | | info.setSenderId(userId); |
| | | info.setConsigneeId(verifyUser); |
| | | info.setViewStatus(false); |
| | | info.setJumpPath("b1-inspect-order-plan"); |
| | | informationNotificationService.addInformationNotification(info); |
| | | /*妿æ¯C类订å䏿¯ä¸åå°è´¨éé¨,åç´æ¥å¤æ ¸éè¿(ç»æè¯éª)*/ |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | if (insOrder.getOrderType().equals("C") && insOrder.getDepartmentLims().equals("è´¨éé¨")) { |
| | | verifyPlan(orderId, laboratory, 2, null); |
| | | }else { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | //LIMSç³»ç»æ¶æ¯æ¨é |
| | | InformationNotification info = new InformationNotification(); |
| | | info.setCreateUser(insProductMapper.selectUserById(userId).get("name")); |
| | | info.setMessageType("2"); |
| | | info.setTheme("夿 ¸éç¥"); |
| | | info.setContent("æ¨æä¸æ¡æ£éªä»»å¡å¾
夿 ¸æ¶æ¯"); |
| | | info.setSenderId(userId); |
| | | info.setConsigneeId(verifyUser); |
| | | info.setViewStatus(false); |
| | | info.setJumpPath("b1-inspect-order-plan"); |
| | | informationNotificationService.addInformationNotification(info); |
| | | //todo ä¼ä¸å¾®ä¿¡æ¶æ¯æ¨é@zss |
| | | /* HashMap<String, Object> map = new HashMap<>(); |
| | | String account = userMapper.selectById(userId).getAccount(); |
| | | map.put("touser", *//*account*//*"ZT-012117");//æ¥æ¶æ¶æ¯æåçè´¦å·'ZT-031292'è¿ç§ç±»å(妿æå¤ä¸ªç¨'|'åé) |
| | | map.put("toparty", "");//æ¥æ¶é¨é¨id |
| | | map.put("totag", "");//æ¶æ¯æ ç¾id |
| | | map.put("msgtype", "text");//æ¶æ¯ç±»å text:ææ¬ |
| | | map.put("agentid", 1000513);//åºç¨id |
| | | HashMap<String, Object> hashMap = new HashMap<>(); |
| | | hashMap.put("content", "æ¨æä¸æ¡æ£éªä»»å¡å¾
夿 ¸æ¶æ¯,请åå¾LIMSç³»ç»æ¥çã<a href=\"http://10.1.13.77/enter\"> </a>"); |
| | | map.put("text", JSONArray.toJSONString(hashMap));//æ¶æ¯å
容 |
| | | map.put("safe", 0);//æ¯å¦ä¿å¯æ¶æ¯.0å¦ |
| | | map.put("enable_id_trans", 0);//æ¯å¦å¼å¯id转è¯.0å¦ |
| | | map.put("enable_duplicate_check", 0);//æ¯å¦å¼å¯é夿¶æ¯æ£æ¥.0å¦ |
| | | qywxApi.send(map);*/ |
| | | } |
| | | //夿 ¸äºº--æ£éªåç¸å
³è´è´£äºº |
| | | InsSampleUser insSampleUser = new InsSampleUser(); |
| | | insSampleUser.setUserId(verifyUser); |
| | |
| | | insSampleUser.setState(1); |
| | | insSampleUser.setSonLaboratory(laboratory); |
| | | insSampleUserMapper.insert(insSampleUser); |
| | | /*妿æ¯C类订å䏿¯ä¸åå°è´¨éé¨,åç´æ¥å¤æ ¸éè¿(ç»æè¯éª)*/ |
| | | InsOrder insOrder = insOrderMapper.selectById(orderId); |
| | | if (insOrder.getOrderType().equals("C") && insOrder.getDepartmentLims().equals("è´¨éé¨")) { |
| | | verifyPlan(orderId, laboratory, 2, null); |
| | | } |
| | | /*æ ¡éªä¸ä¸result表*/ |
| | | CompletableFuture.supplyAsync(() -> { |
| | | List<Integer> ips = insProducts.stream().map(InsProduct::getId).distinct().collect(Collectors.toList()); |
| | |
| | | String key = "frequency" + ":" + entrustCode + ":*"; |
| | | RedisUtil.delsLike(key); |
| | | return 1; |
| | | } |
| | | |
| | | public int pxToCm(int px) { |
| | | return px / 9; |
| | | } |
| | | |
| | | // è·å两个localDateTimeçæ¯ä¸å¤© |