| | |
| | | import com.ruoyi.system.mapper.UserMapper; |
| | | import com.ruoyi.system.service.InformationNotificationService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.openxml4j.util.ZipSecureFile; |
| | | import org.apache.poi.xwpf.usermodel.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | } |
| | | Integer insOrderId = insReportMapper.selectById(id).getInsOrderId(); |
| | | InsOrder order = insOrderMapper.selectById(insOrderId); |
| | | boolean isRawMater = order.getTypeSource() != null && order.getTypeSource().equals(1); |
| | | |
| | | IfsInventoryQuantity ifsInventoryQuantity = null; |
| | | if(ObjectUtils.isNotEmpty(order.getIfsInventoryId())){ |
| | | ifsInventoryQuantity = ifsInventoryQuantityMapper.selectById(order.getIfsInventoryId()); |
| | | } |
| | | boolean isRawMater = order.getTypeSource() != null && !order.getTypeSource().equals(-1); |
| | | String contract = ObjectUtils.isNotEmpty(ifsInventoryQuantity)?ifsInventoryQuantity.getContract():order.getContract();//ifs域 |
| | | //获取场所的报告专用章 |
| | | String sealUrl; |
| | | String laboratory = insOrderMapper.selectById(insReport.getInsOrderId()).getLaboratory(); |
| | |
| | | } else { |
| | | type = "委托报告"; |
| | | } |
| | | sealUrl = insReportMapper.getLaboratoryByName(laboratory, type); |
| | | sealUrl = insReportMapper.getLaboratoryByName(laboratory, type,contract); |
| | | } catch (Exception e) { |
| | | throw new ErrorException(laboratory + "找不到报告专用章"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public int wordInsertUrl(Map<String, Object> map, String url) { |
| | | XWPFTemplate template = XWPFTemplate.compile(url).render(map); |
| | | XWPFTemplate template; |
| | | synchronized (ZipSecureFile.class) { |
| | | double originalMinInflateRatio = ZipSecureFile.getMinInflateRatio(); |
| | | try { |
| | | // 兼容报告中压缩率较高的纯色/透明 PNG,编译后立即恢复 POI 安全阈值。 |
| | | ZipSecureFile.setMinInflateRatio(0.001D); |
| | | template = XWPFTemplate.compile(url); |
| | | } finally { |
| | | ZipSecureFile.setMinInflateRatio(originalMinInflateRatio); |
| | | } |
| | | } |
| | | template.render(map); |
| | | try { |
| | | template.writeAndClose(Files.newOutputStream(Paths.get(url))); |
| | | } catch (IOException e) { |
| | |
| | | IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectOne(new LambdaQueryWrapper<IfsInventoryQuantity>() |
| | | .eq(IfsInventoryQuantity::getId, insOrder.getIfsInventoryId())); |
| | | if (Objects.isNull(one)) { |
| | | throw new ErrorException("找不到原材料信息"); |
| | | throw new ErrorException("找不到销售订单信息"); |
| | | } |
| | | // 判断是否有不合格信息 |
| | | Long count = insUnqualifiedHandlerMapper.selectCount(Wrappers.<InsUnqualifiedHandler>lambdaQuery() |
| | |
| | | //如果是拆分的订单,则把拆分的所有批次都移库 |
| | | if(one.getIsSplitOrder()==1 && !hasExemption){ |
| | | //查询拆分订单详情 |
| | | List<IfsInventoryQuantityVO> ifsInventoryQuantityVOS = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo()); |
| | | List<IfsInventoryQuantityVO> ifsInventoryQuantityVOS = ifsInventoryQuantityMapper.selectSplitOrderList(one.getPartNo(), one.getLineNo(), one.getReleaseNo(), one.getReceiptNo(), one.getOrderNo(),one.getContract()); |
| | | for (IfsInventoryQuantityVO vo : ifsInventoryQuantityVOS) { |
| | | //如果有委托单信息且合格,走登记后移库;如果没有,则走免检;不合格不做处理 |
| | | if(Objects.isNull(vo.getInsOrderId())){ |
| | |
| | | // 企业微信通知 |
| | | String message = ""; |
| | | message += "检测结果提交通知"; |
| | | message += "\nIFS域: " + one.getContract(); |
| | | message += "\n批次号: " + one.getUpdateBatchNo(); |
| | | message += "\n零件号: " + one.getPartNo(); |
| | | message += "\n零件描述: " + one.getPartDesc(); |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |