| | |
| | | @Select("update archive_records set record_status=#{status}, create_time=#{date} where id=#{id}") |
| | | public void updateStatusById(@Param("status") String status, @Param("id")Long id ,@Param("date") Date date); |
| | | |
| | | @Select("select ROW_NUMBER() OVER (ORDER BY record_id) AS num, filing_number, concat_ws(\" \", inquiry_number,record_id) as inqrid, case_title, public_attribute, (select count(*) as cnt from document_materials where record_id=ar.id) as cnt, remarks from archive_records as ar \n" + |
| | | // @Select("select ROW_NUMBER() OVER (ORDER BY record_id) AS num, filing_number, concat_ws(\" \", inquiry_number,record_id) as inqrid, case_title, public_attribute, (select count(*) as cnt from document_materials where record_id=ar.id) as cnt, remarks from archive_records as ar \n" + |
| | | // "${ew.customSqlSegment}") |
| | | |
| | | |
| | | @Select("select ROW_NUMBER() OVER (ORDER BY record_id) AS num, filing_number, concat_ws(\" \", inquiry_number,record_id) as inqrid, case_title, public_attribute, page_count as cnt, remarks from archive_records as ar \n" + |
| | | "${ew.customSqlSegment}") |
| | | public List<ArchiveRecordSmall> selectByIds(@Param("ew") LambdaQueryWrapper<ArchiveRecords> queryWrapper); |
| | | |
| | |
| | | public int insertArchiveCategory(ArchiveCategory archiveCategory) |
| | | { |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | if(archiveCategory.getNname()==null||StringUtils.isEmpty(archiveCategory.getNname())) |
| | | throw new RuntimeException("类别名称不能为空!"); |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveCategory.setCtime(date); |
| | | |
| | | boolean res = this.save(archiveCategory); |
| | | if(res) |
| | | return 1; |
| | |
| | | public int insertArchivePlaceName(ArchivePlaceName archivePlaceName) |
| | | { |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | if(archivePlaceName.getName()==null||StringUtils.isEmpty(archivePlaceName.getName())) |
| | | throw new RuntimeException("地区名称不能为空!"); |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archivePlaceName.setCreateTime(date); |
| | | boolean res = this.save(archivePlaceName); |
| | |
| | | @Override |
| | | public int insertArchiveProjectName(ArchiveProjectName archiveProjectName) { |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | if(archiveProjectName.getName()==null||StringUtils.isEmpty(archiveProjectName.getName())) |
| | | throw new RuntimeException("项目名称不能为空!"); |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | archiveProjectName.setCreateTime(date); |
| | | boolean res = this.save(archiveProjectName); |
| | |
| | | } |
| | | |
| | | assert dataList != null; |
| | | // System.out.println("++++++++++++++++++++000000"); |
| | | |
| | | // System.out.println(dataList.size()); |
| | | // for (ArchiveRecords archiveRecords : dataList) { |
| | | // System.out.println(dataList.size()); |
| | | // |
| | | // } |
| | | for (ArchiveRecords archiveRecords : dataList) { |
| | | // physcialService.mySave(physcial); |
| | | archiveRecords.setRecordStatus("未录入"); |
| | |
| | | LocalDateTime time = LocalDateTime.now(); |
| | | |
| | | Date date = Date.from(time.atZone(ZoneId.systemDefault()).toInstant()); |
| | | for(Long id : ids) |
| | | this.baseMapper.updateStatusById("录入完成",id, date); |
| | | for(Long id : ids) { |
| | | // 获取当前用户ID,收回授权 |
| | | Long userId = SecurityUtils.getUserId(); |
| | | archiverecordstouserService.deleteArchiverecordstouserByRecordId(id, userId); |
| | | |
| | | this.baseMapper.updateStatusById("录入完成", id, date); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | |
| | | @Override |
| | | public AjaxResult mySave(ArchiveRecords archiveRecords) { |
| | | // 检查是否有重复数据插入 |
| | | System.out.println(archiveRecords.getRecordId()+"aaaaaaaaaaaaaaaaa"); |
| | | if(archiveRecords.getRecordId()==null||StringUtils.isEmpty(archiveRecords.getRecordId())) |
| | | throw new RuntimeException("档案号不能为空!"); |
| | | |
| | | LambdaQueryWrapper<ArchiveRecords> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(!StringUtils.isEmpty(archiveRecords.getRecordId()), ArchiveRecords::getRecordId,archiveRecords.getRecordId()); |
| | | List<ArchiveRecords> list = list(lqw); |
| | | if (!list.isEmpty()) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改 |
| | | Long userid = SecurityUtils.getUserId(); |
| | | if (!list.isEmpty()&&userid!=1) { |
| | | // throw new RuntimeException("请勿新增重复数据"); |
| | | //如果有重复数据,则根据recordId进行数据修改sele |
| | | // if() |
| | | |
| | | // |
| | | this.baseMapper.update(archiveRecords, lqw); |
| | | return AjaxResult.success(); |
| | | |
| | | |
| | | } |
| | | else if(!list.isEmpty()) |
| | | { |
| | | throw new RuntimeException("请勿新增重复数据"); |
| | | } |
| | | else { |
| | | Long userid = SecurityUtils.getUserId(); |
| | | |
| | | if(userid==1) { |
| | | if (save(archiveRecords)) { |
| | | return AjaxResult.success(); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | else |
| | | return AjaxResult.error("档案号不存在!"); |
| | | else |
| | | return AjaxResult.error("不是管理员,不能新增记录!"); |
| | | } |
| | | |
| | | } |
| | |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public byte[] generateBarcodeImageScarn(String barcodeText) { |
| | | try { |
| | | // 使用 BitMatrix 生成纯条码,不包含任何文字 |
| | | BarcodeFormat format = BarcodeFormat.CODE_39; // 根据您的条码类型 |
| | | |
| | | // 创建编码器 |
| | | Code39Writer writer = new Code39Writer(); |
| | | |
| | | // 编码参数 |
| | | Map<EncodeHintType, Object> hints = new HashMap<>(); |
| | | hints.put(EncodeHintType.MARGIN, 0); // 无边框 |
| | | |
| | | // 生成 BitMatrix(纯条码,无文字) |
| | | BitMatrix matrix = writer.encode(barcodeText, format, 230, 63, hints); |
| | | |
| | | int width = matrix.getWidth(); |
| | | int height = matrix.getHeight(); |
| | | |
| | | // 计算文字区域 |
| | | int textAreaHeight = 30 + 10; |
| | | |
| | | // 创建最终图像 |
| | | BufferedImage finalImage = new BufferedImage( |
| | | width, |
| | | height + textAreaHeight, |
| | | BufferedImage.TYPE_BYTE_BINARY |
| | | ); |
| | | |
| | | Graphics2D g2d = finalImage.createGraphics(); |
| | | |
| | | // 白色背景 |
| | | g2d.setColor(Color.WHITE); |
| | | g2d.fillRect(0, 0, width, height + textAreaHeight); |
| | | |
| | | // 绘制条码(从 BitMatrix) |
| | | g2d.setColor(Color.BLACK); |
| | | for (int x = 0; x < width; x++) { |
| | | for (int y = 0; y < height; y++) { |
| | | if (matrix.get(x, y)) { |
| | | g2d.fillRect(x, y, 1, 1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 添加自定义文字 |
| | | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); |
| | | g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); |
| | | g2d.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE); |
| | | |
| | | Font font = new Font("Tahoma", Font.PLAIN, 20); |
| | | g2d.setFont(font); |
| | | |
| | | FontMetrics fm = g2d.getFontMetrics(); |
| | | int textWidth = fm.stringWidth(barcodeText); |
| | | int x = (width - textWidth) / 2; |
| | | int y = height + 30 - 5; // 调整垂直位置 |
| | | |
| | | g2d.drawString(barcodeText, x, y); |
| | | g2d.dispose(); |
| | | |
| | | // 保存 |
| | | ByteArrayOutputStream resultStream = new ByteArrayOutputStream(); |
| | | ImageIO.write(finalImage, "png", resultStream); |
| | | |
| | | return resultStream.toByteArray(); |
| | | // return outputStream.toByteArray(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("Error generating barcode", e); |
| | | } catch (WriterException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | //System.out.println(includeQrCode); |
| | | //生成二维码 |
| | | String code = "2024050000029250"; |
| | | byte[] bt = barcodeService.generateBarcodeImage(code); |
| | | byte[] bt = barcodeService.generateBarcodeImageScarn(code); |
| | | // System.out.println(Arrays.toString(selectedSignatures)); |
| | | //签名选择 |
| | | String[] sig = {"业务科室移交人:", "审批科移交人:", "档案整理公司:"}; |
| | | String[] sig = {"业务科室移交人:", "审批科/法规科移交人:","审批科移交人:", "档案整理公司:"}; |
| | | List<String> arrLis = new ArrayList<>(); |
| | | if (searSigAnn.getSelectedSignatures() != null) { |
| | | for (String si : searSigAnn.getSelectedSignatures()) { |
| | |
| | | |
| | | //移交清单 |
| | | List<ArchiveRecordSmall> lrs = iArchiveRecordsService.findByIds(archiveRecords); |
| | | //电子文件的个数 |
| | | System.out.println(lrs); |
| | | System.out.println("99999999990000"); |
| | | ZipEntry entry1 = new ZipEntry(fna + "移交清单" + ".xls"); |