From 20848903c6f08a288460ec00ea1ca779efefa934 Mon Sep 17 00:00:00 2001 From: litao Date: Fri, 16 Sep 2022 16:48:15 +0800 Subject: [PATCH] =?UTF-8?q?2022=E5=B9=B49=E6=9C=8816=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lims/goods/entity/ApplyDetail.java | 38 +- .../springblade/lims/goods/entity/Goods.java | 3 + .../springblade/lims/goods/entity/Report.java | 110 +- .../springblade/system/enums/DictBizEnum.java | 4 + .../file/entity/EquipVerificationLog.java | 93 ++ .../service/impl/ApplyOrderServiceImpl.java | 4 - .../goods/controller/ApplyController.java | 58 +- .../goods/controller/GoodsController.java | 37 +- .../EquipVerificationController.java | 2 +- .../EquipVerificationLogController.java | 56 + .../mapper/EquipVerificationLogMapper.java | 36 + .../mapper/EquipVerificationLogMapper.xml | 25 + .../service/IEquipVerificationLogService.java | 34 + .../impl/EquipVerificationLogServiceImpl.java | 50 + .../lims/controller/EntrustController.java | 27 + .../lims/controller/ExamineController.java | 8 +- .../lims/service/impl/EntrustServiceImpl.java | 1170 ++++++++++++----- .../user/service/impl/UserServiceImpl.java | 10 +- 18 files changed, 1312 insertions(+), 453 deletions(-) create mode 100644 lab-service-api/lab-file-api/src/main/java/org/springblade/file/entity/EquipVerificationLog.java create mode 100644 lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationLogController.java create mode 100644 lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.java create mode 100644 lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.xml create mode 100644 lab-service/lab-file/src/main/java/org/springblade/file/service/IEquipVerificationLogService.java create mode 100644 lab-service/lab-file/src/main/java/org/springblade/file/service/impl/EquipVerificationLogServiceImpl.java diff --git a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/ApplyDetail.java b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/ApplyDetail.java index 6872010..0e79668 100644 --- a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/ApplyDetail.java +++ b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/ApplyDetail.java @@ -26,27 +26,21 @@ public class ApplyDetail extends BaseEntity { private static final long serialVersionUID = 1L; - /** - * 申领id - */ @ApiModelProperty(value = "申领id") private Long applyId; @ApiModelProperty(value = "申领单号") private String applyCode; - /** - * 物品类型 - */ + @ApiModelProperty(value = "物品类型(2:耗材,1:资产)") private Integer type; - /** - * 物品编号 - */ + @ApiModelProperty(value = "物品编号") private String productCode; - /** - * 物品编号 - */ + + @ApiModelProperty(value = "物品批次号") + private String batchNum; + @ApiModelProperty(value = "物品id") @JsonSerialize(nullsUsing = NullSerializer.class) private Long productId; @@ -57,24 +51,16 @@ public class ApplyDetail extends BaseEntity { @ApiModelProperty(value = "是否危险品") private Integer danger; - /** - * 申请数量 - */ - @ApiModelProperty(value = "申请数量") + @ApiModelProperty(value = "申领数量") private Integer applyNum; - /** - * 实际出库数量 - */ + @ApiModelProperty(value = "实际出库数量") private Integer outNum; - @ApiModelProperty(value = "实际出库数量") + @ApiModelProperty(value = "异常变更数量") @TableField(exist = false) private Integer newOutNum; - /** - * 归还数量 - */ @ApiModelProperty(value = "归还数量") private Integer returnNum; @@ -82,15 +68,9 @@ public class ApplyDetail extends BaseEntity { @TableField(exist = false) private Integer needReturnNum; - /** - * 单位 - */ @ApiModelProperty(value = "单位") private String unit; - /** - * 归还时间 - */ @ApiModelProperty(value = "归还时间") @DateTimeFormat( pattern = "yyyy-MM-dd HH:mm:ss" diff --git a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Goods.java b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Goods.java index 32cb95f..dd28ab4 100644 --- a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Goods.java +++ b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Goods.java @@ -93,4 +93,7 @@ public class Goods extends BaseEntity { @TableField(exist = false) private List detials; + + @TableField(exist = false) + private String sort; } diff --git a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Report.java b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Report.java index f500112..b67bd47 100644 --- a/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Report.java +++ b/lab-service-api/lab-capital-api/src/main/java/org/springblade/lims/goods/entity/Report.java @@ -21,7 +21,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import org.springblade.core.mp.base.BaseEntity; + import java.time.LocalDateTime; + import lombok.Data; import lombok.EqualsAndHashCode; import io.swagger.annotations.ApiModel; @@ -40,70 +42,50 @@ import org.springframework.format.annotation.DateTimeFormat; @ApiModel(value = "Report对象", description = "报损记录表") public class Report extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** - * 报损物品id - */ - @ApiModelProperty(value = "报损物品id") - @JsonSerialize(using = ToStringSerializer.class) - private Long reportGoodsId; - /** - * 报损物品名称 - */ - @ApiModelProperty(value = "报损物品名称") - private String reportGoodsName; - /** - * 报损数量 - */ - @ApiModelProperty(value = "报损数量") - private Integer reportNum; - /** - * 报损原因 - */ - @ApiModelProperty(value = "报损原因") - private String reportReason; - /** - * 报废申请人id - */ - @ApiModelProperty(value = "报废申请人id") - @JsonSerialize(using = ToStringSerializer.class) - private Long scrapApplyerId; - /** - * 报废申请人名称 - */ - @ApiModelProperty(value = "报废申请人名称") - private String scrapApplyerName; - /** - * 报废申请时间 - */ - @ApiModelProperty(value = "报废申请时间") - private LocalDateTime scrapApplyerTime; - /** - * 报废审核人id - */ - @ApiModelProperty(value = "报废审核人id") - @JsonSerialize(using = ToStringSerializer.class) - private Long scrapCheckerId; - /** - * 报废审核人name - */ - @ApiModelProperty(value = "报废审核人name") - private String scrapCheckerName; - /** - * 报废审核时间 - */ - @ApiModelProperty(value = "报废审核时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime scrapCheckerTime; - /** - * 处理时间 - */ - @ApiModelProperty(value = "处理时间") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private LocalDateTime dealTime; + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "报损物品id") + @JsonSerialize(using = ToStringSerializer.class) + private Long reportGoodsId; + + @ApiModelProperty(value = "报损物品名称") + private String reportGoodsName; + + @ApiModelProperty(value = "报损数量") + private Integer reportNum; + + @ApiModelProperty(value = "批次数量") + private String batchNum; + + @ApiModelProperty(value = "报损原因") + private String reportReason; + + @ApiModelProperty(value = "报废申请人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long scrapApplyerId; + + @ApiModelProperty(value = "报废申请人名称") + private String scrapApplyerName; + + @ApiModelProperty(value = "报废申请时间") + private LocalDateTime scrapApplyerTime; + + @ApiModelProperty(value = "报废审核人id") + @JsonSerialize(using = ToStringSerializer.class) + private Long scrapCheckerId; + + @ApiModelProperty(value = "报废审核人name") + private String scrapCheckerName; + + @ApiModelProperty(value = "报废审核时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime scrapCheckerTime; + + @ApiModelProperty(value = "处理时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime dealTime; } diff --git a/lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java b/lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java index cf94a2a..db86643 100644 --- a/lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java +++ b/lab-service-api/lab-dict-api/src/main/java/org/springblade/system/enums/DictBizEnum.java @@ -65,6 +65,10 @@ public enum DictBizEnum { * 是否留样 */ SIMPLE_NAME_TWO("simpleNameTwo"), + /** + * 打印的url配置 + */ + PRINT_URL("printUrl"), ; diff --git a/lab-service-api/lab-file-api/src/main/java/org/springblade/file/entity/EquipVerificationLog.java b/lab-service-api/lab-file-api/src/main/java/org/springblade/file/entity/EquipVerificationLog.java new file mode 100644 index 0000000..89c4ada --- /dev/null +++ b/lab-service-api/lab-file-api/src/main/java/org/springblade/file/entity/EquipVerificationLog.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.file.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springblade.core.mp.base.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +/** + * 仪器检定管理实体类 + * + * @author BladeX + * @since 2022-07-22 + */ +@Data +@TableName("t_equip_verification_log") +@EqualsAndHashCode(callSuper = true) +@ApiModel(value = "EquipVerification对象", description = "仪器检定管理") +public class EquipVerificationLog extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * 租户ID + */ + @ApiModelProperty(value = "租户ID") + private String tenantId; + /** + * 设备id + */ + private String instrumentId; + /** + * 设备名称 + */ + @ApiModelProperty(value = "设备名称") + private String equipName; + /** + * 规格型号 + */ + @ApiModelProperty(value = "规格型号") + private String equipModel; + /** + * 生产厂家或品牌 + */ + @ApiModelProperty(value = "生产厂家或品牌") + private String manufacturerOrBrand; + /** + * 启用时间 + */ + @ApiModelProperty(value = "启用时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime enableTime; + /** + * 上次检定时间 + */ + @ApiModelProperty(value = "上次检定时间") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime lastVerificationTime; + /** + * 检定周期(天) + */ + @ApiModelProperty(value = "检定周期(天)(业务字典 equip_verification_cycle)") + private Integer cycle; + /** + * 检定次数 + */ + @ApiModelProperty(value = "检定次数") + private Integer total; + +} diff --git a/lab-service/lab-capital/src/main/java/org/springblade/lims/capital/service/impl/ApplyOrderServiceImpl.java b/lab-service/lab-capital/src/main/java/org/springblade/lims/capital/service/impl/ApplyOrderServiceImpl.java index b5e9f08..8dc7aa0 100644 --- a/lab-service/lab-capital/src/main/java/org/springblade/lims/capital/service/impl/ApplyOrderServiceImpl.java +++ b/lab-service/lab-capital/src/main/java/org/springblade/lims/capital/service/impl/ApplyOrderServiceImpl.java @@ -37,7 +37,6 @@ import java.util.List; @AllArgsConstructor public class ApplyOrderServiceImpl extends BaseServiceImpl implements IApplyOrderService { - private final IApplyOrderDetailService applyOrderDetailService; private final ICkOrderService ckOrderService; @@ -52,7 +51,6 @@ public class ApplyOrderServiceImpl extends BaseServiceImpl selectApplyOrderPage(IPage page, ApplyOrderVO applyOrder) { return page.setRecords(baseMapper.selectApplyOrderPage(page, applyOrder)); @@ -60,7 +58,6 @@ public class ApplyOrderServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId()); + wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0])); + ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper); + int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]); + productStoreDetial.setNum(i); + productStoreDetialService.updateById(productStoreDetial); + } + } } applyDetailService.saveBatch(detailList); } @@ -293,7 +313,8 @@ public class ApplyController extends BladeController { */ @PostMapping("/update") public void update(@RequestBody ApplyVO applyVO) { - Apply apply = BeanUtil.copy(applyVO, Apply.class); +// Apply apply = BeanUtil.copy(applyVO, Apply.class); + Apply apply = applyService.getById(applyVO.getId()); apply.setIsUpdate(1); apply.setStatus(2); applyService.updateById(apply); @@ -303,12 +324,47 @@ public class ApplyController extends BladeController { List detailList = applyVO.getDetailList(); if (detailList != null && detailList.size() > 0) { for (ApplyDetail applyDetail : detailList) { + // 修改库存数量 Goods goods = goodsService.getById(applyDetail.getProductId()); Integer bigDecimal = goods.getNum() + applyDetail.getOutNum(); Integer subtract = bigDecimal - applyDetail.getNewOutNum(); goods.setNum(subtract); goodsService.updateById(goods); applyDetail.setOutNum(applyDetail.getNewOutNum()); + + // 修改批次数量 + ApplyDetail detail = applyDetailService.getById(applyDetail.getId()); + // 先恢复申领前数量 + String num = detail.getBatchNum(); + if (num != null && !"".equals(num)) { + String[] split = num.split(","); + for (String s : split) { + String[] strings = s.split(":"); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId()); + wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0])); + ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper); + int i = productStoreDetial.getNum() + Integer.parseInt(strings[1]); + productStoreDetial.setNum(i); + productStoreDetialService.updateById(productStoreDetial); + } + } + // 修改更改后数量 + String batchNum = applyDetail.getBatchNum(); + if (batchNum != null && !"".equals(batchNum)) { + String[] split = batchNum.split(","); + for (String s : split) { + String[] strings = s.split(":"); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProductStoreDetial::getGoodsId, applyDetail.getProductId()); + wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0])); + ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper); + int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]); + productStoreDetial.setNum(i); + productStoreDetialService.updateById(productStoreDetial); + } + } + applyDetail.getBatchNum(); } applyDetailService.updateBatchById(detailList); } diff --git a/lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java b/lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java index 6830258..383e449 100644 --- a/lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java +++ b/lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/GoodsController.java @@ -91,7 +91,7 @@ public class GoodsController extends BladeController { if (goods.getLocation() != null) { queryWrapper.eq(Goods::getLocation, goods.getLocation()); } - queryWrapper.orderByDesc(Goods::getUpdateTime); + queryWrapper.orderByDesc(Goods::getCreateTime); IPage page = goodsService.page(Condition.getPage(query), queryWrapper); List goodsList = page.getRecords(); for (Goods goods1 : goodsList) { @@ -221,11 +221,6 @@ public class GoodsController extends BladeController { //报损 @PostMapping("/report") public void report(@RequestBody Report report) { - // 修改库存 -// Goods goods = goodsService.getById(report.getReportGoodsId()); -// Integer goodsNum = goods.getNum(); -// goods.setNum(goodsNum -= report.getReportNum()); -// goodsService.updateById(goods); // 报损记录 report.setScrapApplyerId(AuthUtil.getUserId()); report.setScrapApplyerName(AuthUtil.getUserName()); @@ -240,9 +235,25 @@ public class GoodsController extends BladeController { Report byId = reportService.getById(report.getId()); // 修改库存 Goods goods = goodsService.getById(byId.getReportGoodsId()); - Integer goodsNum = goods.getNum(); - goods.setNum(goodsNum -= byId.getReportNum()); + Integer goodsNum = goods.getNum() - byId.getReportNum(); + goods.setNum(goodsNum); goodsService.updateById(goods); + // 修改批次数量 + String batchNum = byId.getBatchNum(); + if (batchNum != null && !"".equals(batchNum)) { + String[] split = batchNum.split(","); + for (String s : split) { + String[] strings = s.split(":"); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ProductStoreDetial::getGoodsId, byId.getReportGoodsId()); + wrapper.eq(ProductStoreDetial::getPNum, Integer.parseInt(strings[0])); + ProductStoreDetial productStoreDetial = productStoreDetialService.getOne(wrapper); + int i = productStoreDetial.getNum() - Integer.parseInt(strings[1]); + productStoreDetial.setNum(i); + productStoreDetialService.updateById(productStoreDetial); + } + } + // 报损记录 byId.setScrapCheckerId(AuthUtil.getUserId()); byId.setScrapCheckerName(AuthUtil.getUserName()); @@ -276,8 +287,14 @@ public class GoodsController extends BladeController { public R inDetail(Goods goods, Query query) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(ProductStoreDetial::getGoodsId, goods.getId()); -// wrapper.eq(ProductStoreDetial::getStatus, 0); - wrapper.orderByDesc(ProductStoreDetial::getCreateTime); + if (goods.getStatus() != null) { + wrapper.eq(ProductStoreDetial::getStatus, goods.getStatus()); + } + if (goods.getSort() != null && !"".equals(goods.getSort())) { + wrapper.orderByAsc(ProductStoreDetial::getCreateTime); + } else { + wrapper.orderByDesc(ProductStoreDetial::getCreateTime); + } IPage page = productStoreDetialService.page(Condition.getPage(query), wrapper); List records = page.getRecords(); for (ProductStoreDetial record : records) { diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationController.java b/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationController.java index a960e10..71d7a93 100644 --- a/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationController.java +++ b/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationController.java @@ -38,7 +38,6 @@ import javax.validation.Valid; /** * 仪器检定管理 控制器 - * * @author BladeX * @since 2022-07-22 */ @@ -51,6 +50,7 @@ public class EquipVerificationController extends BladeController { private final IEquipVerificationService equipVerificationService; private final ILimsClient limsClient; + /** * 详情 */ diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationLogController.java b/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationLogController.java new file mode 100644 index 0000000..05d52b0 --- /dev/null +++ b/lab-service/lab-file/src/main/java/org/springblade/file/controller/EquipVerificationLogController.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.file.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Condition; +import org.springblade.core.mp.support.Query; +import org.springblade.core.tool.api.R; +import org.springblade.file.entity.EquipVerificationLog; +import org.springblade.file.service.IEquipVerificationLogService; +import org.springframework.web.bind.annotation.*; + +/** + * 仪器检定管理 控制器 + * + * @author BladeX + * @since 2022-07-22 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/equipVerificationLog") +@Api(value = "仪器检定记录", tags = "仪器检定记录") +public class EquipVerificationLogController extends BladeController { + + private final IEquipVerificationLogService equipVerificationLogService; + + @GetMapping("/list") + public R list(EquipVerificationLog equipVerificationLog, Query query) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + if (equipVerificationLog.getEquipName() != null && !"".equals(equipVerificationLog.getEquipName())) { + wrapper.like(EquipVerificationLog::getEquipName,equipVerificationLog.getEquipName()).or() + .like(EquipVerificationLog::getEquipModel,equipVerificationLog.getEquipName()).or() + .like(EquipVerificationLog::getManufacturerOrBrand,equipVerificationLog.getEquipName()); + } + wrapper.orderByDesc(EquipVerificationLog::getCreateTime); + return R.data(equipVerificationLogService.page(Condition.getPage(query), wrapper)); + } +} diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.java b/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.java new file mode 100644 index 0000000..5cf9c5d --- /dev/null +++ b/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.file.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.file.entity.EquipVerification; +import org.springblade.file.entity.EquipVerificationLog; +import org.springblade.file.vo.EquipVerificationVO; + +import java.util.List; + +/** + * 仪器检定管理 Mapper 接口 + * + * @author BladeX + * @since 2022-07-22 + */ +public interface EquipVerificationLogMapper extends BaseMapper { + + +} diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.xml b/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.xml new file mode 100644 index 0000000..7d9d201 --- /dev/null +++ b/lab-service/lab-file/src/main/java/org/springblade/file/mapper/EquipVerificationLogMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/service/IEquipVerificationLogService.java b/lab-service/lab-file/src/main/java/org/springblade/file/service/IEquipVerificationLogService.java new file mode 100644 index 0000000..c1fb7bf --- /dev/null +++ b/lab-service/lab-file/src/main/java/org/springblade/file/service/IEquipVerificationLogService.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.file.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseService; +import org.springblade.file.entity.EquipVerification; +import org.springblade.file.entity.EquipVerificationLog; +import org.springblade.file.vo.EquipVerificationVO; + +/** + * 仪器检定管理 服务类 + * + * @author BladeX + * @since 2022-07-22 + */ +public interface IEquipVerificationLogService extends BaseService { + + +} diff --git a/lab-service/lab-file/src/main/java/org/springblade/file/service/impl/EquipVerificationLogServiceImpl.java b/lab-service/lab-file/src/main/java/org/springblade/file/service/impl/EquipVerificationLogServiceImpl.java new file mode 100644 index 0000000..ca14b8a --- /dev/null +++ b/lab-service/lab-file/src/main/java/org/springblade/file/service/impl/EquipVerificationLogServiceImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package org.springblade.file.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; +import org.springblade.file.entity.EquipVerification; +import org.springblade.file.entity.EquipVerificationLog; +import org.springblade.file.enums.EquipVerificationEnum; +import org.springblade.file.mapper.EquipVerificationLogMapper; +import org.springblade.file.mapper.EquipVerificationMapper; +import org.springblade.file.service.IEquipVerificationLogService; +import org.springblade.file.service.IEquipVerificationService; +import org.springblade.file.vo.EquipVerificationVO; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Optional; + +/** + * 仪器检定管理 服务实现类 + * + * @author BladeX + * @since 2022-07-22 + */ +@Service +public class EquipVerificationLogServiceImpl extends BaseServiceImpl implements IEquipVerificationLogService { + + +} diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java index a63bc5b..4dc3b0e 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java @@ -18,6 +18,7 @@ import com.spire.doc.documents.HorizontalAlignment; import com.spire.doc.documents.Paragraph; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import oracle.jdbc.proxy.annotation.Post; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.springblade.core.secure.utils.AuthUtil; @@ -827,6 +828,10 @@ public class EntrustController extends BladeController { map.put("ywc", service.count(queryWrapper)); queryWrapper.clear(); + queryWrapper.eq("entrust_status", "-1"); + map.put("yzf", service.count(queryWrapper)); + queryWrapper.clear(); + // queryWrapper.eq("entrust_status", "-1"); // map.put("sb", service.count(queryWrapper)); // } @@ -1627,4 +1632,26 @@ public class EntrustController extends BladeController { public void repairPrint(String id, HttpServletResponse response) { service.repairPrint(id, response); } + + /** + * 26.委托单报废 + */ + @PostMapping("/entrustScrap") + public R entrustScrap(@RequestParam String id) { + // 修改委托单状态 + Entrust entrust = new Entrust(); + entrust.setId(Long.valueOf(id)); + entrust.setEntrustStatus("-1"); + // 修改检测 + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(Examine::getEntrustId, id); + List examineList = examineService.list(wrapper); + if (examineList != null && examineList.size() > 0) { + for (Examine examine : examineList) { + examine.setStatus(-1); + } + examineService.updateBatchById(examineList); + } + return R.status(service.updateById(entrust)); + } } diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java index 21c5cb1..4a2eecf 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java @@ -287,8 +287,8 @@ public class ExamineController extends BladeController { if ("4".equals(examine.getEntrustStatus())) { wrapper.eq(Examine::getStatus, 1); } - //审核驳回 - if ("5".equals(examine.getEntrustStatus())) { + //审核作废 + if ("-1".equals(examine.getEntrustStatus())) { wrapper.eq(Examine::getStatus, -1); } // 模糊查询 @@ -332,7 +332,7 @@ public class ExamineController extends BladeController { @GetMapping("/getExmineStatusAndCount") public R> getExmineStatusAndCount(String deptId) { Map map = new HashMap<>(10); - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("is_distribute", 0); queryWrapper.eq("status", 0); @@ -360,7 +360,7 @@ public class ExamineController extends BladeController { queryWrapper.eq("status", -1); queryWrapper.eq("dept_id", deptId); - map.put("bh", examineService.count(queryWrapper)); + map.put("yzf", examineService.count(queryWrapper)); queryWrapper.clear(); return R.data(map); diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java index 5d049b9..a17ac5c 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java @@ -296,13 +296,15 @@ public class EntrustServiceImpl extends BaseServiceImpl result.put("resultList", resultList); result.put("list", resultList1); + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "handleUrl"); + //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//委托单(模板).docx"; XWPFDocument doc = null; // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(handleUrl, result); + doc = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//委托单.docx"); String filename = "测试.docx"; @@ -364,37 +366,37 @@ public class EntrustServiceImpl extends BaseServiceImpl // 根据检测的数量判断用按个模板 switch (examineCount) { case 1: - currTemplate = print1; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print1"); break; case 2: - currTemplate = print2; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print2"); break; case 3: - currTemplate = print3; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print3"); break; case 4: - currTemplate = print4; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print4"); break; case 5: - currTemplate = print5; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print5"); break; case 6: - currTemplate = print6; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print6"); break; case 7: - currTemplate = print7; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print7"); break; case 8: - currTemplate = print8; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print8"); break; case 9: - currTemplate = print9; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print9"); break; case 10: - currTemplate = print10; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print10"); break; default: - currTemplate = print10; + currTemplate = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "print10"); } List resultList = new ArrayList<>(); @@ -1117,64 +1119,133 @@ public class EntrustServiceImpl extends BaseServiceImpl if ("2".equals(byId.getInputMode())) { List list = JSON.parseArray(examineResult.getExamineDataArr(), ExamineTemplate2Excel.class); if (list.size() > 0) { - if (list.size() % 2 == 0) { - for (int i = 0; i < list.size() / 2; i++) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getValue()); - map.put("result1", list.get(i).getResult()); - map.put("num2", list.get(list.size() / 2 + i).getExperieNum()); - map.put("value2", list.get(list.size() / 2 + i).getValue()); - map.put("result2", list.get(list.size() / 2 + i).getResult()); - resultList1.add(map); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list.size(); j++) { + if (count == 60 || j == list.size() - 1) { + int keyCount = (j / 60); + if (j == list.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; } - } else { - for (int i = 0; i < list.size() / 2 + 1; i++) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getValue()); - map.put("result1", list.get(i).getResult()); - if (i < list.size() / 2) { - map.put("num2", list.get(list.size() / 2 + i + 1).getExperieNum()); - map.put("value2", list.get(list.size() / 2 + i + 1).getValue()); - map.put("result2", list.get(list.size() / 2 + i + 1).getResult()); - } - resultList1.add(map); + everyGroupData.add(list.get(j)); + count++; + + } + for (int j = 1; j <= resultMap.size(); j++) { + List arrVOList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (arrVOList.size() % 2 == 0) { + for (int i = 0; i < arrVOList.size() / 2; i++) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + map.put("num2", arrVOList.get(arrVOList.size() / 2 + i).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 2 + i).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 2 + i).getResult()); + resultList1.add(map); + } + } else { + for (int i = 0; i < arrVOList.size() / 2 + 1; i++) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + if (i < arrVOList.size() / 2) { + map.put("num2", arrVOList.get(arrVOList.size() / 2 + i + 1).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 2 + i + 1).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 2 + i + 1).getResult()); + } + resultList1.add(map); + } } } result.put("list", resultList1); - url = BLSreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "BLSreportPrint"); } } // PCR检测 else if ("4".equals(byId.getInputMode())) { List list = JSON.parseArray(examineResult.getExamineDataArr(), PCR2Excel.class); if (list.size() > 0) { - if (list.size() % 2 == 0) { - for (int i = 0; i < list.size() / 2; i++) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getCtValue()); - map.put("result1", list.get(i).getValue()); - map.put("num2", list.get(list.size() / 2 + i).getExperieNum()); - map.put("value2", list.get(list.size() / 2 + i).getCtValue()); - map.put("result2", list.get(list.size() / 2 + i).getValue()); - resultList1.add(map); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list.size(); j++) { + if (count == 60 || j == list.size() - 1) { + int keyCount = (j / 60); + if (j == list.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; } - } else { - for (int i = 0; i < list.size() / 2 + 1; i++) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getCtValue()); - map.put("result1", list.get(i).getValue()); - if (i < list.size() / 2) { - map.put("num2", list.get(list.size() / 2 + i + 1).getExperieNum()); - map.put("value2", list.get(list.size() / 2 + i + 1).getCtValue()); - map.put("result2", list.get(list.size() / 2 + i + 1).getValue()); - } - resultList1.add(map); + everyGroupData.add(list.get(j)); + count++; + + } + for (int j = 1; j <= resultMap.size(); j++) { + List arrVOList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (arrVOList.size() % 2 == 0) { + for (int i = 0; i < arrVOList.size() / 2; i++) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getCtValue()); + map.put("result1", arrVOList.get(i).getValue()); + map.put("num2", arrVOList.get(arrVOList.size() / 2 + i).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 2 + i).getCtValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 2 + i).getValue()); + resultList1.add(map); + } + } else { + for (int i = 0; i < arrVOList.size() / 2 + 1; i++) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getCtValue()); + map.put("result1", arrVOList.get(i).getValue()); + if (i < arrVOList.size() / 2) { + map.put("num2", arrVOList.get(arrVOList.size() / 2 + i + 1).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 2 + i + 1).getCtValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 2 + i + 1).getValue()); + } + resultList1.add(map); + } } } +// if (list.size() % 2 == 0) { +// for (int i = 0; i < list.size() / 2; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list.get(i).getExperieNum()); +// map.put("value1", list.get(i).getCtValue()); +// map.put("result1", list.get(i).getValue()); +// map.put("num2", list.get(list.size() / 2 + i).getExperieNum()); +// map.put("value2", list.get(list.size() / 2 + i).getCtValue()); +// map.put("result2", list.get(list.size() / 2 + i).getValue()); +// resultList1.add(map); +// } +// } else { +// for (int i = 0; i < list.size() / 2 + 1; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list.get(i).getExperieNum()); +// map.put("value1", list.get(i).getCtValue()); +// map.put("result1", list.get(i).getValue()); +// if (i < list.size() / 2) { +// map.put("num2", list.get(list.size() / 2 + i + 1).getExperieNum()); +// map.put("value2", list.get(list.size() / 2 + i + 1).getCtValue()); +// map.put("result2", list.get(list.size() / 2 + i + 1).getValue()); +// } +// resultList1.add(map); +// } +// } if (examineResult.getPicturePath() != null && !"".equals(examineResult.getPicturePath())) { String[] sp = examineResult.getPicturePath().split(","); for (String picturePath : sp) { @@ -1215,62 +1286,131 @@ public class EntrustServiceImpl extends BaseServiceImpl } result.put("list1", resultList2); result.put("list", resultList1); - url = PCRreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "PCRreportPrint"); } // XN检测 else if ("5".equals(byId.getInputMode())) { List list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class); if (list.size() > 0) { - if (list.size() % 3 == 0) { - for (int i = 0; i < list.size() / 3; i++) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getCtValue()); - map.put("result1", list.get(i).getValue()); - map.put("num2", list.get(list.size() / 3 + i).getExperieNum()); - map.put("value2", list.get(list.size() / 3 + i).getCtValue()); - map.put("result2", list.get(list.size() / 3 + i).getValue()); - map.put("num3", list.get(list.size() / 3 * 2 + i).getExperieNum()); - map.put("value3", list.get(list.size() / 3 * 2 + i).getCtValue()); - map.put("result3", list.get(list.size() / 3 * 2 + i).getValue()); - resultList1.add(map); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list.size(); j++) { + if (count == 60 || j == list.size() - 1) { + int keyCount = (j / 60); + if (j == list.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; } - } else { - for (int i = 0; i < list.size() / 3 + 1; i++) { - if (list.size() % 3 == 1) { + everyGroupData.add(list.get(j)); + count++; + + } + for (int j = 1; j <= resultMap.size(); j++) { + List arrVOList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (arrVOList.size() % 3 == 0) { + for (int i = 0; i < arrVOList.size() / 3; i++) { Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getCtValue()); - map.put("result1", list.get(i).getValue()); - if (i < list.size() / 3) { - map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum()); - map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue()); - map.put("result2", list.get(list.size() / 3 + i + 1).getValue()); - map.put("num3", list.get(list.size() / 3 * 2 + i + 1).getExperieNum()); - map.put("value3", list.get(list.size() / 3 * 2 + i + 1).getCtValue()); - map.put("result3", list.get(list.size() / 3 * 2 + i + 1).getValue()); - } + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getCtValue()); + map.put("result1", arrVOList.get(i).getValue()); + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i).getCtValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i).getValue()); + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getExperieNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getCtValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getValue()); resultList1.add(map); - } else if (list.size() % 3 == 2) { - Map map = new HashMap<>(); - map.put("num1", list.get(i).getExperieNum()); - map.put("value1", list.get(i).getCtValue()); - map.put("result1", list.get(i).getValue()); - map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum()); - map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue()); - map.put("result2", list.get(list.size() / 3 + i + 1).getValue()); - if (i < list.size() / 3) { - map.put("num3", list.get(list.size() / 3 * 2 + i + 2).getExperieNum()); - map.put("value3", list.get(list.size() / 3 * 2 + i + 2).getCtValue()); - map.put("result3", list.get(list.size() / 3 * 2 + i + 2).getValue()); + } + } else { + for (int i = 0; i < arrVOList.size() / 3 + 1; i++) { + if (arrVOList.size() % 3 == 1) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getCtValue()); + map.put("result1", arrVOList.get(i).getValue()); + if (i < arrVOList.size() / 3) { + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getCtValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getExperieNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getCtValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getValue()); + } + resultList1.add(map); + } else if (arrVOList.size() % 3 == 2) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getExperieNum()); + map.put("value1", arrVOList.get(i).getCtValue()); + map.put("result1", arrVOList.get(i).getValue()); + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getExperieNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getCtValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + if (i < arrVOList.size() / 3) { + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getExperieNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getCtValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getValue()); + } + resultList1.add(map); } - resultList1.add(map); } } } +// if (list.size() % 3 == 0) { +// for (int i = 0; i < list.size() / 3; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list.get(i).getExperieNum()); +// map.put("value1", list.get(i).getCtValue()); +// map.put("result1", list.get(i).getValue()); +// map.put("num2", list.get(list.size() / 3 + i).getExperieNum()); +// map.put("value2", list.get(list.size() / 3 + i).getCtValue()); +// map.put("result2", list.get(list.size() / 3 + i).getValue()); +// map.put("num3", list.get(list.size() / 3 * 2 + i).getExperieNum()); +// map.put("value3", list.get(list.size() / 3 * 2 + i).getCtValue()); +// map.put("result3", list.get(list.size() / 3 * 2 + i).getValue()); +// resultList1.add(map); +// } +// } else { +// for (int i = 0; i < list.size() / 3 + 1; i++) { +// if (list.size() % 3 == 1) { +// Map map = new HashMap<>(); +// map.put("num1", list.get(i).getExperieNum()); +// map.put("value1", list.get(i).getCtValue()); +// map.put("result1", list.get(i).getValue()); +// if (i < list.size() / 3) { +// map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum()); +// map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue()); +// map.put("result2", list.get(list.size() / 3 + i + 1).getValue()); +// map.put("num3", list.get(list.size() / 3 * 2 + i + 1).getExperieNum()); +// map.put("value3", list.get(list.size() / 3 * 2 + i + 1).getCtValue()); +// map.put("result3", list.get(list.size() / 3 * 2 + i + 1).getValue()); +// } +// resultList1.add(map); +// } else if (list.size() % 3 == 2) { +// Map map = new HashMap<>(); +// map.put("num1", list.get(i).getExperieNum()); +// map.put("value1", list.get(i).getCtValue()); +// map.put("result1", list.get(i).getValue()); +// map.put("num2", list.get(list.size() / 3 + i + 1).getExperieNum()); +// map.put("value2", list.get(list.size() / 3 + i + 1).getCtValue()); +// map.put("result2", list.get(list.size() / 3 + i + 1).getValue()); +// if (i < list.size() / 3) { +// map.put("num3", list.get(list.size() / 3 * 2 + i + 2).getExperieNum()); +// map.put("value3", list.get(list.size() / 3 * 2 + i + 2).getCtValue()); +// map.put("result3", list.get(list.size() / 3 * 2 + i + 2).getValue()); +// } +// resultList1.add(map); +// } +// } +// } } result.put("list", resultList1); - url = XNreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "XNreportPrint"); } // 普通和口蹄疫检测 else { @@ -1314,56 +1454,129 @@ public class EntrustServiceImpl extends BaseServiceImpl list1.addAll(voList); if (list1.size() > 0) { - if (list1.size() % 3 == 0) { - for (int i = 0; i < list1.size() / 3; i++) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); - - map.put("num2", list1.get(list1.size() / 3 + i).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i).getResult()); - - map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); - resultList1.add(map); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list1.size(); j++) { + if (count == 90 || j == list1.size() - 1) { + int keyCount = (j / 90); + if (j == list1.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list1.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; } - } else { - for (int i = 0; i < list1.size() / 3 + 1; i++) { - if (list1.size() % 3 == 1) { + everyGroupData.add(list1.get(j)); + count++; + + } + for (int j = 1; j <= resultMap.size(); j++) { + List arrVOList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (arrVOList.size() % 3 == 0) { + for (int i = 0; i < arrVOList.size() / 3; i++) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); - if (i < list1.size() / 3) { - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i + 1).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); - } + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i).getResult()); + + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getResult()); resultList1.add(map); - } else if (list1.size() % 3 == 2) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - if (i < list1.size() / 3) { - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i + 2).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); + } + } else { + for (int i = 0; i < arrVOList.size() / 3 + 1; i++) { + if (arrVOList.size() % 3 == 1) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + if (i < arrVOList.size() / 3) { + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult()); + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getResult()); + } + resultList1.add(map); + } else if (arrVOList.size() % 3 == 2) { + Map map = new HashMap<>(); + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult()); + if (i < arrVOList.size() / 3) { + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getResult()); + } + resultList1.add(map); } - resultList1.add(map); } } } +// if (list1.size() % 3 == 0) { +// for (int i = 0; i < list1.size() / 3; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("value1", list1.get(i).getValue()); +// map.put("result1", list1.get(i).getResult()); +// +// map.put("num2", list1.get(list1.size() / 3 + i).getNum()); +// map.put("value2", list1.get(list1.size() / 3 + i).getValue()); +// map.put("result2", list1.get(list1.size() / 3 + i).getResult()); +// +// map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); +// map.put("value3", list1.get(list1.size() / 3 * 2 + i).getValue()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); +// resultList1.add(map); +// } +// } +// else { +// for (int i = 0; i < list1.size() / 3 + 1; i++) { +// if (list1.size() % 3 == 1) { +// +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("value1", list1.get(i).getValue()); +// map.put("result1", list1.get(i).getResult()); +// if (i < list1.size() / 3) { +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); +// map.put("value3", list1.get(list1.size() / 3 * 2 + i + 1).getValue()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); +// } +// resultList1.add(map); +// } else if (list1.size() % 3 == 2) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("value1", list1.get(i).getValue()); +// map.put("result1", list1.get(i).getResult()); +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// if (i < list1.size() / 3) { +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); +// map.put("value3", list1.get(list1.size() / 3 * 2 + i + 2).getValue()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); +// } +// resultList1.add(map); +// } +// } +// } result.put("list1", resultList1); } for (int i = 0; i < (list.size() / 96); i++) { @@ -1371,10 +1584,31 @@ public class EntrustServiceImpl extends BaseServiceImpl if (i == 0) { start = 0; } - for (int j = 0; j < 9; j++) { + String startNum = ""; + String endNum = ""; + for (int k = 0; k < 96; k++) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + startNum = num.split("-")[2]; + break; + } + } + for (int k = 95; k >= 0; k--) { + if ((i * 96) + k < list.size()) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + endNum = num.split("-")[2]; + break; + } + } + } + for (int j = 0; j < 10; j++) { int x = 0; Map map = new HashMap<>(); if (j == 0) { + map.put("1", s + "(" + startNum + "-" + endNum + ")"); + } + else if (j == 1) { map.put("0", " "); map.put("1", "1"); map.put("2", "2"); @@ -1400,34 +1634,35 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("22", "10"); map.put("23", "11"); map.put("24", "12"); - } else { - if (j == 1) { + } + else { + if (j == 2) { map.put("0", "A"); } - if (j == 2) { + if (j == 3) { map.put("0", "B"); } - if (j == 3) { + if (j == 4) { map.put("0", "C"); } - if (j == 4) { + if (j == 5) { map.put("0", "D"); } - if (j == 5) { + if (j == 6) { map.put("0", "E"); } - if (j == 6) { + if (j == 7) { map.put("0", "F"); } - if (j == 7) { + if (j == 8) { map.put("0", "G"); } - if (j == 8) { + if (j == 9) { map.put("0", "H"); } for (int k = 1; k <= 12; k++) { - map.put(k + "", list.get(start + (8 * x + j) - 1).getValue()); - String num = list.get(start + (8 * x + j) - 1).getNum(); + map.put(k + "", list.get(start + (8 * x + j) - 2).getValue()); + String num = list.get(start + (8 * x + j) - 2).getNum(); if (num != null && !"".equals(num) && num.split("-").length == 3) { map.put((k + 12) + "", num.split("-")[2]); } else { @@ -1463,7 +1698,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } } result.put("list2", resultList2); - url = LDanreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "LDanreportPrint"); } // 口蹄疫兰所多板 else if ("2".equals(examine.getTemplateType())) { @@ -1502,66 +1737,159 @@ public class EntrustServiceImpl extends BaseServiceImpl } if (list1.size() > 0) { - if (list1.size() % 3 == 0) { - for (int i = 0; i < list1.size() / 3; i++) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list1.size(); j++) { + if (count == 90 || j == list1.size() - 1) { + int keyCount = (j / 90); + if (j == list1.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list1.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; + } + everyGroupData.add(list1.get(j)); + count++; - map.put("num2", list1.get(list1.size() / 3 + i).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i).getLog2()); + } - map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i).getLog2()); - resultList1.add(map); - } - } else { - for (int i = 0; i < list1.size() / 3 + 1; i++) { - if (list1.size() % 3 == 1) { + for (int j = 1; j <= resultMap.size(); j++) { + List voList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (voList.size() % 3 == 0) { + for (int i = 0; i < voList.size() / 3; i++) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); - if (i < list1.size() / 3) { - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i + 1).getLog2()); - } + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + + map.put("num2", voList.get(voList.size() / 3 + i).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i).getResult()); + + map.put("num3", voList.get(voList.size() / 3 * 2 + i).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i).getResult()); resultList1.add(map); - } else if (list1.size() % 3 == 2) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); - if (i < list1.size() / 3) { - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i + 2).getLog2()); + } + } else { + for (int i = 0; i < voList.size() / 3 + 1; i++) { + if (voList.size() % 3 == 1) { + Map map = new HashMap<>(); + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + if (i < voList.size() / 3) { + map.put("num2", voList.get(voList.size() / 3 + i + 1).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i + 1).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i + 1).getResult()); + map.put("num3", voList.get(voList.size() / 3 * 2 + i + 1).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i + 1).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i + 1).getResult()); + } + resultList1.add(map); + } else if (voList.size() % 3 == 2) { + Map map = new HashMap<>(); + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + map.put("num2", voList.get(voList.size() / 3 + i + 1).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i + 1).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i + 1).getResult()); + if (i < voList.size() / 3) { + map.put("num3", voList.get(voList.size() / 3 * 2 + i + 2).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i + 2).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i + 2).getResult()); + } + resultList1.add(map); } - resultList1.add(map); } } } - result.put("list1", resultList1); +// if (list1.size() % 3 == 0) { +// for (int i = 0; i < list1.size() / 3; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// +// map.put("num2", list1.get(list1.size() / 3 + i).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i).getLog2()); +// +// map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i).getLog2()); +// resultList1.add(map); +// } +// } else { +// for (int i = 0; i < list1.size() / 3 + 1; i++) { +// if (list1.size() % 3 == 1) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// if (i < list1.size() / 3) { +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i + 1).getLog2()); +// } +// resultList1.add(map); +// } else if (list1.size() % 3 == 2) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); +// if (i < list1.size() / 3) { +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i + 2).getLog2()); +// } +// resultList1.add(map); +// } +// } +// } +// result.put("list1", resultList1); } for (int i = 0; i < (arrVOList.size() / 96); i++) { int start = i * 96; if (i == 0) { start = 0; } - for (int j = 0; j < 9; j++) { + String startNum = ""; + String endNum = ""; + for (int k = 0; k < 96; k++) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + startNum = num.split("-")[2]; + break; + } + } + for (int k = 95; k >= 0; k--) { + if ((i * 96) + k < list.size()) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + endNum = num.split("-")[2]; + break; + } + } + } + for (int j = 0; j < 10; j++) { int x = 0; Map map = new HashMap<>(); if (j == 0) { + map.put("1", s + "(" + startNum + "-" + endNum + ")"); + } + else if (j == 1) { map.put("0", " "); map.put("1", "1"); map.put("2", "2"); @@ -1587,34 +1915,35 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("22", "10"); map.put("23", "11"); map.put("24", "12"); - } else { - if (j == 1) { + } + else { + if (j == 2) { map.put("0", "A"); } - if (j == 2) { + if (j == 3) { map.put("0", "B"); } - if (j == 3) { + if (j == 4) { map.put("0", "C"); } - if (j == 4) { + if (j == 5) { map.put("0", "D"); } - if (j == 5) { + if (j == 6) { map.put("0", "E"); } - if (j == 6) { + if (j == 7) { map.put("0", "F"); } - if (j == 7) { + if (j == 8) { map.put("0", "G"); } - if (j == 8) { + if (j == 9) { map.put("0", "H"); } for (int k = 1; k <= 12; k++) { - map.put(k + "", arrVOList.get(start + (8 * x + j) - 1).getValue()); - String num = arrVOList.get(start + (8 * x + j) - 1).getNum(); + map.put(k + "", arrVOList.get(start + (8 * x + j) - 2).getValue()); + String num = arrVOList.get(start + (8 * x + j) - 2).getNum(); if (num != null && !"".equals(num) && num.split("-").length == 3) { map.put((k + 12) + "", num.split("-")[2]); } else { @@ -1650,7 +1979,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } } result.put("list2", resultList2); - url = LDuoreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "LDuoreportPrint"); } // 口蹄疫非兰所 else { @@ -1689,55 +2018,127 @@ public class EntrustServiceImpl extends BaseServiceImpl } if (list1.size() > 0) { - if (list1.size() % 3 == 0) { - for (int i = 0; i < list1.size() / 3; i++) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list1.size(); j++) { + if (count == 90 || j == list1.size() - 1) { + int keyCount = (j / 90); + if (j == list1.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list1.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; + } + everyGroupData.add(list1.get(j)); + count++; - map.put("num2", list1.get(list1.size() / 3 + i).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i).getLog2()); + } - map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i).getLog2()); - resultList1.add(map); - } - } else { - for (int i = 0; i < list1.size() / 3 + 1; i++) { - if (list1.size() % 3 == 1) { + for (int j = 1; j <= resultMap.size(); j++) { + List voList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (voList.size() % 3 == 0) { + for (int i = 0; i < voList.size() / 3; i++) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); - if (i < list1.size() / 3) { - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i + 1).getLog2()); - } + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + + map.put("num2", voList.get(voList.size() / 3 + i).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i).getResult()); + + map.put("num3", voList.get(voList.size() / 3 * 2 + i).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i).getResult()); resultList1.add(map); - } else if (list1.size() % 3 == 2) { - Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("result1", list1.get(i).getResult()); - map.put("log1", list1.get(i).getLog2()); - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); - if (i < list1.size() / 3) { - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); - map.put("log3", list1.get(list1.size() / 3 * 2 + i + 2).getLog2()); + } + } else { + for (int i = 0; i < voList.size() / 3 + 1; i++) { + if (voList.size() % 3 == 1) { + Map map = new HashMap<>(); + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + if (i < voList.size() / 3) { + map.put("num2", voList.get(voList.size() / 3 + i + 1).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i + 1).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i + 1).getResult()); + map.put("num3", voList.get(voList.size() / 3 * 2 + i + 1).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i + 1).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i + 1).getResult()); + } + resultList1.add(map); + } else if (voList.size() % 3 == 2) { + Map map = new HashMap<>(); + map.put("num1", voList.get(i).getNum()); + map.put("value1", voList.get(i).getValue()); + map.put("result1", voList.get(i).getResult()); + map.put("num2", voList.get(voList.size() / 3 + i + 1).getNum()); + map.put("value2", voList.get(voList.size() / 3 + i + 1).getValue()); + map.put("result2", voList.get(voList.size() / 3 + i + 1).getResult()); + if (i < voList.size() / 3) { + map.put("num3", voList.get(voList.size() / 3 * 2 + i + 2).getNum()); + map.put("value3", voList.get(voList.size() / 3 * 2 + i + 2).getValue()); + map.put("result3", voList.get(voList.size() / 3 * 2 + i + 2).getResult()); + } + resultList1.add(map); } - resultList1.add(map); } } } +// if (list1.size() % 3 == 0) { +// for (int i = 0; i < list1.size() / 3; i++) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// +// map.put("num2", list1.get(list1.size() / 3 + i).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i).getLog2()); +// +// map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i).getLog2()); +// resultList1.add(map); +// } +// } else { +// for (int i = 0; i < list1.size() / 3 + 1; i++) { +// if (list1.size() % 3 == 1) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// if (i < list1.size() / 3) { +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i + 1).getLog2()); +// } +// resultList1.add(map); +// } else if (list1.size() % 3 == 2) { +// Map map = new HashMap<>(); +// map.put("num1", list1.get(i).getNum()); +// map.put("result1", list1.get(i).getResult()); +// map.put("log1", list1.get(i).getLog2()); +// map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); +// map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); +// map.put("log2", list1.get(list1.size() / 3 + i + 1).getLog2()); +// if (i < list1.size() / 3) { +// map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); +// map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); +// map.put("log3", list1.get(list1.size() / 3 * 2 + i + 2).getLog2()); +// } +// resultList1.add(map); +// } +// } +// } result.put("list1", resultList1); } for (int i = 0; i < (arrVOList.size() / 96); i++) { @@ -1745,10 +2146,31 @@ public class EntrustServiceImpl extends BaseServiceImpl if (i == 0) { start = 0; } - for (int j = 0; j < 9; j++) { + String startNum = ""; + String endNum = ""; + for (int k = 0; k < 96; k++) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + startNum = num.split("-")[2]; + break; + } + } + for (int k = 95; k >= 0; k--) { + if ((i * 96) + k < list.size()) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + endNum = num.split("-")[2]; + break; + } + } + } + for (int j = 0; j < 10; j++) { int x = 0; Map map = new HashMap<>(); if (j == 0) { + map.put("1", s + "(" + startNum + "-" + endNum + ")"); + } + else if (j == 1) { map.put("0", " "); map.put("1", "1"); map.put("2", "2"); @@ -1774,34 +2196,35 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("22", "10"); map.put("23", "11"); map.put("24", "12"); - } else { - if (j == 1) { + } + else { + if (j == 2) { map.put("0", "A"); } - if (j == 2) { + if (j == 3) { map.put("0", "B"); } - if (j == 3) { + if (j == 4) { map.put("0", "C"); } - if (j == 4) { + if (j == 5) { map.put("0", "D"); } - if (j == 5) { + if (j == 6) { map.put("0", "E"); } - if (j == 6) { + if (j == 7) { map.put("0", "F"); } - if (j == 7) { + if (j == 8) { map.put("0", "G"); } - if (j == 8) { + if (j == 9) { map.put("0", "H"); } for (int k = 1; k <= 12; k++) { - map.put(k + "", arrVOList.get(start + (8 * x + j) - 1).getValue()); - String num = arrVOList.get(start + (8 * x + j) - 1).getNum(); + map.put(k + "", arrVOList.get(start + (8 * x + j) - 2).getValue()); + String num = arrVOList.get(start + (8 * x + j) - 2).getNum(); if (num != null && !"".equals(num) && num.split("-").length == 3) { map.put((k + 12) + "", num.split("-")[2]); } else { @@ -1837,7 +2260,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } } result.put("list2", resultList2); - url = LDuoreportPrint; + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "LDuoreportPrint"); } } // 普通检测 @@ -1900,54 +2323,72 @@ public class EntrustServiceImpl extends BaseServiceImpl } if (list1.size() > 0) { - for (int j = 0; j < list1.size() / 90 + 1; j++) { - List list2 = new ArrayList<>(); - if (list1.size() % 3 == 0) { - for (int i = 0; i < list1.size() / 3; i++) { + Map> resultMap = new HashMap<>(); + int count = 0; + List everyGroupData = new ArrayList<>(); + for (int j = 0; j < list1.size(); j++) { + if (count == 90 || j == list1.size() - 1) { + int keyCount = (j / 90); + if (j == list1.size() - 1) { + keyCount = keyCount + 1; + everyGroupData.add(list1.get(j)); + } + resultMap.put(keyCount + "", everyGroupData); + everyGroupData = new ArrayList<>(); + count = 0; + } + everyGroupData.add(list1.get(j)); + count++; + + } + + for (int j = 1; j <= resultMap.size(); j++) { + List arrVOList = resultMap.get(String.valueOf(j)); + // 使用每一页的数据 + if (arrVOList.size() % 3 == 0) { + for (int i = 0; i < arrVOList.size() / 3; i++) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); - map.put("num2", list1.get(list1.size() / 3 + i).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i).getResult()); + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i).getResult()); - map.put("num3", list1.get(list1.size() / 3 * 2 + i).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i).getResult()); resultList1.add(map); } - } - else { - for (int i = 0; i < list1.size() / 3 + 1; i++) { - if (list1.size() % 3 == 1) { - + } else { + for (int i = 0; i < arrVOList.size() / 3 + 1; i++) { + if (arrVOList.size() % 3 == 1) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); - if (i < list1.size() / 3) { - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 1).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i + 1).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 1).getResult()); + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + if (i < arrVOList.size() / 3) { + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult()); + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 1).getResult()); } resultList1.add(map); - } else if (list1.size() % 3 == 2) { + } else if (arrVOList.size() % 3 == 2) { Map map = new HashMap<>(); - map.put("num1", list1.get(i).getNum()); - map.put("value1", list1.get(i).getValue()); - map.put("result1", list1.get(i).getResult()); - map.put("num2", list1.get(list1.size() / 3 + i + 1).getNum()); - map.put("value2", list1.get(list1.size() / 3 + i + 1).getValue()); - map.put("result2", list1.get(list1.size() / 3 + i + 1).getResult()); - if (i < list1.size() / 3) { - map.put("num3", list1.get(list1.size() / 3 * 2 + i + 2).getNum()); - map.put("value3", list1.get(list1.size() / 3 * 2 + i + 2).getValue()); - map.put("result3", list1.get(list1.size() / 3 * 2 + i + 2).getResult()); + map.put("num1", arrVOList.get(i).getNum()); + map.put("value1", arrVOList.get(i).getValue()); + map.put("result1", arrVOList.get(i).getResult()); + map.put("num2", arrVOList.get(arrVOList.size() / 3 + i + 1).getNum()); + map.put("value2", arrVOList.get(arrVOList.size() / 3 + i + 1).getValue()); + map.put("result2", arrVOList.get(arrVOList.size() / 3 + i + 1).getResult()); + if (i < arrVOList.size() / 3) { + map.put("num3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getNum()); + map.put("value3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getValue()); + map.put("result3", arrVOList.get(arrVOList.size() / 3 * 2 + i + 2).getResult()); } resultList1.add(map); } @@ -1956,7 +2397,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } result.put("list1", resultList1); } - url = reportPrint; + // 原始酶标板数据 if (list.size() % 96 != 0) { for (int i = 0; i < (list.size() / 96 + 1); i++) { @@ -1964,10 +2405,32 @@ public class EntrustServiceImpl extends BaseServiceImpl if (i == 0) { start = 0; } - for (int j = 0; j < 9; j++) { + String startNum = ""; + String endNum = ""; + for (int k = 0; k < 96; k++) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + startNum = num.split("-")[2]; + break; + } + } + for (int k = 95; k >= 0; k--) { + if ((i * 96) + k < list.size()) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + endNum = num.split("-")[2]; + break; + } + } + } + + for (int j = 0; j < 10; j++) { int x = 0; Map map = new HashMap<>(); if (j == 0) { + map.put("1", s + "(" + startNum + "-" + endNum + ")"); + } + else if (j == 1) { map.put("0", " "); map.put("1", "1"); map.put("2", "2"); @@ -1993,35 +2456,36 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("22", "10"); map.put("23", "11"); map.put("24", "12"); - } else { - if (j == 1) { + } + else { + if (j == 2) { map.put("0", "A"); } - if (j == 2) { + if (j == 3) { map.put("0", "B"); } - if (j == 3) { + if (j == 4) { map.put("0", "C"); } - if (j == 4) { + if (j == 5) { map.put("0", "D"); } - if (j == 5) { + if (j == 6) { map.put("0", "E"); } - if (j == 6) { + if (j == 7) { map.put("0", "F"); } - if (j == 7) { + if (j == 8) { map.put("0", "G"); } - if (j == 8) { + if (j == 9) { map.put("0", "H"); } for (int k = 1; k <= 12; k++) { - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put(k + "", list.get(start + (8 * x + j) - 1).getOriginResult()); - String num = list.get(start + (8 * x + j) - 1).getNum(); + if (list.size() - 1 >= start + (8 * x + j) - 2) { + map.put(k + "", list.get(start + (8 * x + j) - 2).getOriginResult()); + String num = list.get(start + (8 * x + j) - 2).getNum(); if (num != null && !"".equals(num) && num.split("-").length == 3) { map.put((k + 12) + "", num.split("-")[2]); } else { @@ -2093,10 +2557,31 @@ public class EntrustServiceImpl extends BaseServiceImpl if (i == 0) { start = 0; } - for (int j = 0; j < 9; j++) { + String startNum = ""; + String endNum = ""; + for (int k = 0; k < 96; k++) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + startNum = num.split("-")[2]; + break; + } + } + for (int k = 95; k >= 0; k--) { + if ((i * 96) + k < list.size()) { + String num = list.get((i * 96) + k).getNum(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + endNum = num.split("-")[2]; + break; + } + } + } + for (int j = 0; j < 10; j++) { int x = 0; Map map = new HashMap<>(); if (j == 0) { + map.put("1", s + "(" + startNum + "-" + endNum + ")"); + } + else if (j == 1) { map.put("0", " "); map.put("1", "1"); map.put("2", "2"); @@ -2122,34 +2607,35 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("22", "10"); map.put("23", "11"); map.put("24", "12"); - } else { - if (j == 1) { + } + else { + if (j == 2) { map.put("0", "A"); } - if (j == 2) { + if (j == 3) { map.put("0", "B"); } - if (j == 3) { + if (j == 4) { map.put("0", "C"); } - if (j == 4) { + if (j == 5) { map.put("0", "D"); } - if (j == 5) { + if (j == 6) { map.put("0", "E"); } - if (j == 6) { + if (j == 7) { map.put("0", "F"); } - if (j == 7) { + if (j == 8) { map.put("0", "G"); } - if (j == 8) { + if (j == 9) { map.put("0", "H"); } for (int k = 1; k <= 12; k++) { - map.put(k + "", list.get(start + (8 * x + j) - 1).getOriginResult()); - String num = list.get(start + (8 * x + j) - 1).getNum(); + map.put(k + "", list.get(start + (8 * x + j) - 2).getOriginResult()); + String num = list.get(start + (8 * x + j) - 2).getNum(); if (num != null && !"".equals(num) && num.split("-").length == 3) { map.put((k + 12) + "", num.split("-")[2]); } else { @@ -2186,6 +2672,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } } result.put("list2", resultList2); + url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "reportPrint"); } } @@ -2252,10 +2739,11 @@ public class EntrustServiceImpl extends BaseServiceImpl //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//留样登记表(模板).docx"; + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "simpleRegisterPrint"); XWPFDocument doc = null; // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(simpleRegisterPrint, result); + doc = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//留样登记表.docx"); String filename = "测试.docx"; @@ -2345,13 +2833,13 @@ public class EntrustServiceImpl extends BaseServiceImpl //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//样品编号对应(模板).docx"; - + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "simpleNumberPrint"); XWPFDocument doc1 = null; XWPFDocument doc2 = null; // FileOutputStream fos = null; try { - doc1 = WordExportUtil.exportWord07(simpleNumberPrint, result); - doc2 = WordExportUtil.exportWord07(simpleNumberPrint, result); + doc1 = WordExportUtil.exportWord07(url, result); + doc2 = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//样品编号对应.docx"); // String filename = "测试.docx"; @@ -2502,11 +2990,11 @@ public class EntrustServiceImpl extends BaseServiceImpl //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测任务书(模板).docx"; - + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "eTaskPrint"); XWPFDocument doc = null; // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(eTaskPrint, result); + doc = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//检测任务书.docx"); // String filename = "测试.docx"; response.setContentType("application/octet-stream"); @@ -2549,7 +3037,6 @@ public class EntrustServiceImpl extends BaseServiceImpl entrust.setIsHandle("1"); this.updateById(entrust); - Map result = new HashMap<>(); List> resultList = new ArrayList<>(); @@ -2574,10 +3061,11 @@ public class EntrustServiceImpl extends BaseServiceImpl //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表(模板).docx"; + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "simpleHandlePrint"); XWPFDocument doc = null; // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(simpleHandlePrint, result); + doc = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表.docx"); // String filename = "测试.docx"; @@ -2645,9 +3133,10 @@ public class EntrustServiceImpl extends BaseServiceImpl result.put("list", list); result.put("1", currEntrust.getAcceptanceNum()); XWPFDocument doc = null; + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "simpleReceivePrint"); // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(simpleReceivePrint, result); + doc = WordExportUtil.exportWord07(url, result); // fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//样品接收发放登记表.docx"); response.setContentType("application/octet-stream"); response.setHeader("content-disposition", "attachment;filename=12344.docx"); @@ -2991,12 +3480,14 @@ public class EntrustServiceImpl extends BaseServiceImpl } } + + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "examineReportPrint"); //模板地址 // String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//留样处理(销毁)申请表(模板).docx"; XWPFDocument doc = null; // FileOutputStream fos = null; try { - doc = WordExportUtil.exportWord07(examineReportPrint, mapList); + doc = WordExportUtil.exportWord07(url, mapList); // fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//examineReportPrint01.docx"); // String filename = "测试.docx"; @@ -3082,8 +3573,9 @@ public class EntrustServiceImpl extends BaseServiceImpl result.put("27", format.format(repair.getAcceptedDate())); result.put("28", repair.getRemark()); result.put("29", repair.getUserComments()); + String url = DictBizCache.getKey(DictBizEnum.PRINT_URL.getName(), "repairPrint"); try { - doc = WordExportUtil.exportWord07(repairPrint, result); + doc = WordExportUtil.exportWord07(url, result); fos = new FileOutputStream(srcPathName + "//" + repair.getName() + "报修申请表.docx"); } catch (Exception e) { e.printStackTrace(); diff --git a/lab-service/lab-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java b/lab-service/lab-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java index 1570b4e..451c799 100644 --- a/lab-service/lab-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java +++ b/lab-service/lab-user/src/main/java/org/springblade/system/user/service/impl/UserServiceImpl.java @@ -111,11 +111,19 @@ public class UserServiceImpl extends BaseServiceImpl implement @Override public boolean updateUserInfo(User user) { + String realPath = sysClient.getParamValue("electronic_signature_real_path").getData(); + User byId = this.getById(user.getId()); + if (byId.getElectronicSignature() != null && !"".equals(byId.getElectronicSignature())) { + File file = new File(realPath + byId.getElectronicSignature()); + if (file.exists()) { + file.delete(); + } + } user.setPassword(null); if (!"".equals(user.getElectronicSignature()) && user.getElectronicSignature() != null) { Random random = new Random(); String fileName = random.nextLong() + ".png"; - String path = sysClient.getParamValue("electronic_signature_real_path").getData() + fileName; + String path = realPath + fileName; // byte[] bytes = Base64Utils.decodeFromString(user.getElectronicSignature()); // byte[] decode = Base64.getMimeDecoder().decode(user.getElectronicSignature());