diff --git a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/listener/TaskEventListener.java b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/listener/TaskEventListener.java index fa690ac..445eb6d 100644 --- a/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/listener/TaskEventListener.java +++ b/lab-plugin/lab-workflow/src/main/java/org/springblade/plugin/workflow/listener/TaskEventListener.java @@ -224,8 +224,8 @@ public class TaskEventListener implements TaskListener, ApplicationContextAware // result.setOriginRecord(jsonString); if (!isAutoRun) { if (name.equals("simpleStatus")) { result.setSimpleStatus(value); } - if (name.equals("temperature")) { result.setTemperature(value); } - if (name.equals("humidity")) { result.setHumidity(value); } +// if (name.equals("temperature")) { result.setTemperature(value); } +// if (name.equals("humidity")) { result.setHumidity(value); } if (name.equals("disposal")) { result.setDisposal(value); } if (name.equals("instrumentId")) { result.setInstrumentId(value); } if (name.equals("reagentId")) { result.setReagentId(value); } 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 704a1a7..cf94a2a 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 @@ -61,6 +61,10 @@ public enum DictBizEnum { * 是否留样 */ SIMPLE_STATUS("simple_status"), + /** + * 是否留样 + */ + SIMPLE_NAME_TWO("simpleNameTwo"), ; diff --git a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Reagent.java b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Reagent.java index e0175be..6af6a07 100644 --- a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Reagent.java +++ b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Reagent.java @@ -52,7 +52,7 @@ public class Reagent extends BaseEntity implements Serializable { // 操作步骤 private String operationSteps; - // 操作步骤 + // 结果判定方法 private String resultDeterminationMethod; // 仪器设备id private String instrumentId; diff --git a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/RepairApplication.java b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/RepairApplication.java index 4426435..158667a 100644 --- a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/RepairApplication.java +++ b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/RepairApplication.java @@ -101,4 +101,12 @@ public class RepairApplication extends BaseEntity implements Serializable { // 备注 private String remark; + // 开始时间 + @TableField(exist = false) + private Date startTime; + + // 结束时间 + @TableField(exist = false) + private Date endTime; + } \ No newline at end of file diff --git a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ScrapApplication.java b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ScrapApplication.java new file mode 100644 index 0000000..3cd398b --- /dev/null +++ b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/ScrapApplication.java @@ -0,0 +1,107 @@ +package org.springblade.lims.entry; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.NullSerializer; +import lombok.Data; +import org.springblade.core.mp.base.BaseEntity; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author swj + */ +@Data +@SuppressWarnings("all") +@TableName("t_scrap_application") +public class ScrapApplication extends BaseEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + // 仪器/设备id + private Long instrumentId; + // 仪器/设备编号 + private String code; + // 仪器/设备名称 + private String name; + // 仪器/设备类型 + private String type; + // 购置时间 + private Date purchaseTime; + // 处理情况 + private String handling; + // 金额 + private Double money; + // 报废原因及技术状况 + private String reasonAndState; + // 申请人 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long equipmentId; + // 申请人姓名 + private String equipmentName; + // 确认日期 + private Date applyDate; + // 部门负责人 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long applyDeptUser; + // 部门负责人姓名 + private String applyDeptUserName; + // 审核意见 + private String reviewComments; + // 审核时间 + private Date reviewDate; + // 业务室id + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long businessOfficeId; + // 业务室姓名 + private String businessOfficeName; + // 审批意见 + private String approvalComments; + // 审批时间 + private Date approvalDate; + // 中心主任id + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long centerDirectorId; + // 中心主任姓名 + private String centerDirectorName; + // 维修记录 + private String maintenanceRecord; + // 维修人 + private String maintainer; + // 维修时间 + private Date maintainerDate; + // 总工时 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double workingHours; + // 人工费 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double laborCost; + // 材料费 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double materialCost; + // 总计费 + @JsonSerialize(nullsUsing = NullSerializer.class) + private Double totalCost; + // 用户意见 + private String userComments; + // 验收人id + @JsonSerialize(nullsUsing = NullSerializer.class) + private Long acceptedBy; + // 验收人姓名 + private String acceptedName; + // 验收时间 + private Date acceptedDate; + // 备注 + private String remark; + + // 开始时间 + @TableField(exist = false) + private Date startTime; + + // 结束时间 + @TableField(exist = false) + private Date endTime; + +} \ No newline at end of file diff --git a/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/feign/ILimsClient.java b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/feign/ILimsClient.java new file mode 100644 index 0000000..2377474 --- /dev/null +++ b/lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/feign/ILimsClient.java @@ -0,0 +1,23 @@ +package org.springblade.lims.feign; + +import org.springblade.common.constant.LauncherConstant; +import org.springblade.core.tool.api.R; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * lims Feign接口类 + * + * @author Chill + */ +@FeignClient( + value = LauncherConstant.APPLICATION_LIMS_NAME +) +public interface ILimsClient { + + String API_PREFIX = "/client/lims"; + String UPDATE_INSTRUMENT_STATUS = API_PREFIX + "/updateStatus"; + + @PostMapping(UPDATE_INSTRUMENT_STATUS) + R updateStatus(String instrumentId); +} 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 a7593d3..6830258 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 @@ -7,11 +7,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; -import com.sun.xml.internal.ws.resources.UtilMessages; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import oracle.jdbc.proxy.annotation.Post; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; @@ -23,11 +21,9 @@ import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.lims.capital.entity.*; import org.springblade.lims.capital.excel.GoodsExcel; -import org.springblade.lims.capital.excel.ProductExcel; import org.springblade.lims.capital.service.IGoodsCheckLogService; import org.springblade.lims.capital.service.IProductClassService; import org.springblade.lims.capital.service.IProductStoreDetialService; -import org.springblade.lims.common.OrderUtils; import org.springblade.lims.goods.entity.ApplyDetail; import org.springblade.lims.goods.entity.Goods; import org.springblade.lims.goods.entity.InAndOutRecord; @@ -41,16 +37,13 @@ import org.springblade.system.cache.DictBizCache; import org.springblade.system.enums.DictBizEnum; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; -import org.springframework.transaction.reactive.AbstractReactiveTransactionManager; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDateTime; import java.util.*; -import java.util.stream.Collectors; import static java.util.stream.Collectors.toList; diff --git a/lab-service/lab-file/pom.xml b/lab-service/lab-file/pom.xml index d6b0889..991d92f 100644 --- a/lab-service/lab-file/pom.xml +++ b/lab-service/lab-file/pom.xml @@ -46,6 +46,12 @@ lab-user-api ${bladex.project.version} + + + org.springblade + lab-lims-api + ${bladex.project.version} + 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 08a9e30..a960e10 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 @@ -31,6 +31,7 @@ import org.springblade.file.entity.EquipVerification; import org.springblade.file.service.IEquipVerificationService; import org.springblade.file.vo.EquipVerificationVO; import org.springblade.file.wrapper.EquipVerificationWrapper; +import org.springblade.lims.feign.ILimsClient; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; @@ -49,6 +50,7 @@ public class EquipVerificationController extends BladeController { private final IEquipVerificationService equipVerificationService; + private final ILimsClient limsClient; /** * 详情 */ @@ -110,6 +112,7 @@ public class EquipVerificationController extends BladeController { @ApiOperationSupport(order = 6) @ApiOperation(value = "新增或修改", notes = "传入equipVerification") public R submit(@Valid @RequestBody EquipVerification equipVerification) { + limsClient.updateStatus(equipVerification.getInstrumentId()); return R.status(equipVerificationService.saveOrUpdate(equipVerification)); } 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 b5502ee..a63bc5b 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 @@ -1620,5 +1620,11 @@ public class EntrustController extends BladeController { return entrust; } - -} \ No newline at end of file + /** + * 25.打印维修单 + */ + @GetMapping("/repairPrint") + public void repairPrint(String id, HttpServletResponse response) { + service.repairPrint(id, response); + } +} diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java index d008f35..4021d66 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java @@ -87,17 +87,13 @@ public class ExamineResultController extends BladeController { ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId()); if ("2".equals(examineItem.getInputMode())) { return blsExcel(file, examineId); - } - else if ("3".equals(examineItem.getInputMode())) { + } else if ("3".equals(examineItem.getInputMode())) { return ktyExcel(file, examineId); - } - else if ("4".equals(examineItem.getInputMode())) { + } else if ("4".equals(examineItem.getInputMode())) { return pcrExcel(file, examineId); - } - else if ("5".equals(examineItem.getInputMode())) { + } else if ("5".equals(examineItem.getInputMode())) { return xnExcel(file, examineId); - } - else { + } else { return ptExcel(file, examineId); } } @@ -137,6 +133,7 @@ public class ExamineResultController extends BladeController { List> list = new ArrayList<>(); // 按照公式计算实验数据并返回 Map>>> map1 = new HashMap<>(); + for (int i = 0; i < group; i++) { List>> mapList = new ArrayList<>(); List excels = map.get(i + 1 + ""); @@ -186,7 +183,8 @@ public class ExamineResultController extends BladeController { map3.put("value", SP); // int b = (i * 90) + j - 6; int b = (i * 96) + j; - map3.put("num", split[b - ((i + 1) * 6)]); +// map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); if (Double.parseDouble(SP) >= 0.4) { map3.put("result", "阳性"); @@ -195,6 +193,14 @@ public class ExamineResultController extends BladeController { } map2.put(a + 1, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j; + map3.put("order", b + 1); + map3.put("num", ""); + map2.put(a + 1, map3); + list.add(map3); } } else { if (excels.get(j).getCode1() != null) { @@ -206,9 +212,10 @@ public class ExamineResultController extends BladeController { list.add(map3); } else { Map map3 = new HashMap<>(); - map3.put("originResult", " "); + map3.put("originResult", ""); int b = (i * 96) + j; map3.put("order", b + 1); + map3.put("num", ""); map2.put(a + 1, map3); list.add(map3); } @@ -222,7 +229,7 @@ public class ExamineResultController extends BladeController { map3.put("value", SP); // int b = (i * 90) + j + 2 + (u * 8); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -232,6 +239,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 2, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 2, map3); + list.add(map3); } if (excels.get(j).getCode3() != null) { if ((v2 - v1) != 0) { @@ -241,7 +257,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode3()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -251,6 +267,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 3, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 3, map3); + list.add(map3); } if (excels.get(j).getCode4() != null) { if ((v2 - v1) != 0) { @@ -260,7 +285,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode4()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -270,6 +295,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 4, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 4, map3); + list.add(map3); } if (excels.get(j).getCode5() != null) { if ((v2 - v1) != 0) { @@ -279,7 +313,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode5()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -289,6 +323,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 5, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 5, map3); + list.add(map3); } if (excels.get(j).getCode6() != null) { if ((v2 - v1) != 0) { @@ -298,7 +341,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode6()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -308,6 +351,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 6, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 6, map3); + list.add(map3); } if (excels.get(j).getCode7() != null) { if ((v2 - v1) != 0) { @@ -317,7 +369,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode7()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -327,6 +379,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 7, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 7, map3); + list.add(map3); } if (excels.get(j).getCode8() != null) { if ((v2 - v1) != 0) { @@ -336,7 +397,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode8()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -346,6 +407,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 8, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 8, map3); + list.add(map3); } if (excels.get(j).getCode9() != null) { if ((v2 - v1) != 0) { @@ -355,7 +425,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode9()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -365,6 +435,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 9, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 9, map3); + list.add(map3); } if (excels.get(j).getCode10() != null) { if ((v2 - v1) != 0) { @@ -374,7 +453,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode10()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -384,6 +463,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 10, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 10, map3); + list.add(map3); } if (excels.get(j).getCode11() != null) { if ((v2 - v1) != 0) { @@ -393,7 +481,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode11()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -403,6 +491,15 @@ public class ExamineResultController extends BladeController { } map2.put(a + 11, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 11, map3); + list.add(map3); } if (excels.get(j).getCode12() != null) { if ((v2 - v1) != 0) { @@ -412,7 +509,7 @@ public class ExamineResultController extends BladeController { map3.put("originResult", excels.get(j).getCode12()); map3.put("value", SP); int b = (i * 96) + j + (u * 8); - map3.put("num", split[b - ((i + 1) * 6)]); + map3.put("num", "1"); map3.put("order", b + 1); u++; if (Double.parseDouble(SP) >= 0.4) { @@ -422,12 +519,41 @@ public class ExamineResultController extends BladeController { } map2.put(a + 12, map3); list.add(map3); + } else { + Map map3 = new HashMap<>(); + map3.put("originResult", ""); + int b = (i * 96) + j + (u * 8); + map3.put("num", ""); + map3.put("order", b + 1); + u++; + map2.put(a + 12, map3); + list.add(map3); } mapList.add(map2); } map1.put("g" + (i + 1), mapList); } + Collections.sort(list, new Comparator>() { + @Override + public int compare(Map o1, Map o2) { + Integer id1 = (Integer) o1.get("order"); + Integer id2 = (Integer) o2.get("order"); + // 升序 + return id1.compareTo(id2); + } + }); + + int numIndex = 0; + for (Map stringObjectMap : list) { + String num = (String) stringObjectMap.get("num"); + if (num != null && !"".equals(num)) { + num = split[numIndex]; + stringObjectMap.put("num", num); + numIndex++; + } + } + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(ExamineResult::getExamineId, examineId); ExamineResult result = service.getOne(wrapper); @@ -593,14 +719,16 @@ public class ExamineResultController extends BladeController { if (result != null) { result.setOriginRecordData(JSON.toJSONString(mapList)); result.setOriginRecordResult(JSON.toJSONString(mapList)); - result.setExamineDataArr(JSON.toJSONString(list)); +// result.setExamineDataArr(JSON.toJSONString(list)); + result.setExamineDataArr(JSON.toJSONString(resultList)); service.updateById(result); } else { ExamineResult examineResult = new ExamineResult(); examineResult.setExamineId(Long.valueOf(examine.getId())); examineResult.setOriginRecordData(JSON.toJSONString(mapList)); examineResult.setOriginRecordResult(JSON.toJSONString(mapList)); - examineResult.setExamineDataArr(JSON.toJSONString(list)); +// examineResult.setExamineDataArr(JSON.toJSONString(list)); + examineResult.setExamineDataArr(JSON.toJSONString(resultList)); service.save(examineResult); } return R.data(mapList); @@ -633,7 +761,7 @@ public class ExamineResultController extends BladeController { Double avg1 = calcCurrGroupContrastAvg(rowInGroup1); for (int row = 0; row < rowInGroup1.size(); row++) { // 行标头:前端渲染需要A、B、C.... - String a = String.valueOf((char)(row + 65)); + String a = String.valueOf((char) (row + 65)); // 每一个位置的值: A1、B2... Map> allPosDatasInAGroup = new HashMap<>(); int u = 1; @@ -659,7 +787,7 @@ public class ExamineResultController extends BladeController { Double avg2 = calcCurrGroupContrastAvg(rowInGroup2); for (int row = 0; row < rowInGroup2.size(); row++) { // 行标头:前端渲染需要A、B、C.... - String a = String.valueOf((char)(row + 65)); + String a = String.valueOf((char) (row + 65)); // 每一个位置的值: A1、B2... Map> allPosDatasInAGroup = new HashMap<>(); int u = 1; @@ -712,8 +840,7 @@ public class ExamineResultController extends BladeController { result.setOriginRecordResult(JSON.toJSONString(resultMap)); result.setExamineDataArr(JSON.toJSONString(allDatas)); service.updateById(result); - } - else { + } else { ExamineResult examineResult = new ExamineResult(); examineResult.setExamineId(Long.valueOf(examine.getId())); examineResult.setOriginRecordData(JSON.toJSONString(allData)); @@ -752,7 +879,7 @@ public class ExamineResultController extends BladeController { Double avg1 = calcCurrGroupContrastAvg(rowInGroup1); for (int row = 0; row < rowInGroup1.size(); row++) { // 行标头:前端渲染需要A、B、C.... - String a = String.valueOf((char)(row + 65)); + String a = String.valueOf((char) (row + 65)); // 每一个位置的值: A1、B2... Map> allPosDatasInAGroup = new HashMap<>(); int u = 1; @@ -778,7 +905,7 @@ public class ExamineResultController extends BladeController { Double avg2 = calcCurrGroupContrastAvg(rowInGroup2); for (int row = 0; row < rowInGroup2.size(); row++) { // 行标头:前端渲染需要A、B、C.... - String a = String.valueOf((char)(row + 65)); + String a = String.valueOf((char) (row + 65)); // 每一个位置的值: A1、B2... Map> allPosDatasInAGroup = new HashMap<>(); int u = 1; @@ -829,8 +956,7 @@ public class ExamineResultController extends BladeController { result.setOriginRecordResult(JSON.toJSONString(resultMap)); result.setExamineDataArr(JSON.toJSONString(allDatas)); service.updateById(result); - } - else { + } else { ExamineResult examineResult = new ExamineResult(); examineResult.setExamineId(Long.valueOf(examine.getId())); examineResult.setOriginRecordData(JSON.toJSONString(allData)); diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/InstrumentController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/InstrumentController.java index 1ef1582..5f0886e 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/InstrumentController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/InstrumentController.java @@ -54,24 +54,29 @@ public class InstrumentController extends BladeController { public R> list(Instrument entry, Query query) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); // 仪器类型 - if (entry.getType() != null && !"".equals(entry.getType())) { - wrapper.eq(Instrument::getType, entry.getType()); - } +// if (entry.getType() != null && !"".equals(entry.getType())) { +// wrapper.eq(Instrument::getType, entry.getType()); +// } // 保管人 - if (entry.getSaveById() != null) { - wrapper.eq(Instrument::getSaveById, entry.getSaveById()); - } +// if (entry.getSaveById() != null) { +// wrapper.eq(Instrument::getSaveById, entry.getSaveById()); +// } // 模糊查询 + if (entry.getStatus() != null) { + wrapper.eq(Instrument::getStatus, entry.getStatus()); + } if (entry.getName() != null && !"".equals(entry.getName())) { - wrapper.like(Instrument::getName, entry.getName()).or(); - wrapper.like(Instrument::getCode, entry.getName()).or(); - wrapper.like(Instrument::getStoragePlace, entry.getName()).or(); - wrapper.like(Instrument::getManufacturerBrand, entry.getName()); + wrapper.and(wq -> wq + .like(Instrument::getName, entry.getName()).or() + .like(Instrument::getCode, entry.getName()).or() + .like(Instrument::getStoragePlace, entry.getName()).or() + .like(Instrument::getManufacturerBrand, entry.getName()) + ); } // 时间范围搜索 - if (entry.getStartTime() != null && entry.getEndTime() != null) { - wrapper.ge(Instrument::getPurchaseTime, entry.getStartTime()).le(Instrument::getPurchaseTime, entry.getEndTime()); - } +// if (entry.getStartTime() != null && entry.getEndTime() != null) { +// wrapper.ge(Instrument::getPurchaseTime, entry.getStartTime()).le(Instrument::getPurchaseTime, entry.getEndTime()); +// } wrapper.orderByDesc(Instrument::getCreateTime); IPage page = service.page(Condition.getPage(query), wrapper); return R.data(page); @@ -107,6 +112,7 @@ public class InstrumentController extends BladeController { String name = userClient.userInfoById(entry.getSaveById()).getData().getName(); entry.setSaveByName(name); } + entry.setStatus(0); return service.save(entry); } diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ReagentController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ReagentController.java index 15e92ce..ec21046 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ReagentController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ReagentController.java @@ -11,19 +11,28 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.excel.util.ExcelUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; import org.springblade.lims.entry.*; +import org.springblade.lims.excel.ExamineExcel; +import org.springblade.lims.excel.ReagentExcel; import org.springblade.lims.service.IETaskService; import org.springblade.lims.service.IInstrumentService; import org.springblade.lims.service.IReagentService; +import org.springblade.system.cache.DictBizCache; +import org.springblade.system.enums.DictBizEnum; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** @@ -130,4 +139,59 @@ public class ReagentController extends BladeController { return service.list(wrapper); } + /** + * excle批量导入试剂 + */ + @PostMapping("inExcle") + public R inExcle(MultipartFile file) throws Exception { + List excelList = ExcelUtil.read(file, ReagentExcel.class); + List list = service.list(); + List reagentList = new ArrayList<>(); + if (excelList != null && excelList.size() > 0) { + for (ReagentExcel reagentExcel : excelList) { + // 重名校验 + for (Reagent reagent : list) { + if (reagentExcel.getName().equals(reagent.getName())) { + throw new Exception("名称重复: " + reagentExcel.getName()); + } + } + + Reagent reagent = new Reagent(); + reagent.setName(reagentExcel.getName()); + reagent.setManufacturer(reagentExcel.getManufacturer()); + reagent.setResultDeterminationMethod(reagentExcel.getResultDeterminationMethod()); + // 字典查询试剂样品类型 + String type = DictBizCache.getKey(DictBizEnum.SIMPLE_NAME_TWO.getName(), reagentExcel.getSimpleType()); + List operationList = new ArrayList<>(); + TypeAndOperation typeAndOperation = new TypeAndOperation(); + typeAndOperation.setType(type); + typeAndOperation.setOperation(reagentExcel.getOperationSteps()); + operationList.add(typeAndOperation); + reagent.setTypeAndOperation(JSON.toJSONString(operationList)); + reagentList.add(reagent); + } + } + return R.status(service.saveBatch(reagentList)); + } + + /** + * excle模板下载 + */ + @GetMapping("downExcle") + public void exportInOrder(HttpServletResponse response) { + List list = new ArrayList<>(); + ReagentExcel excel1 = new ReagentExcel(); + excel1.setName("a试剂"); + excel1.setManufacturer("a厂家"); + excel1.setSimpleType("全血"); + excel1.setOperationSteps("全血的操作步骤"); + excel1.setResultDeterminationMethod("全血的结果判定"); + ReagentExcel excel2 = new ReagentExcel(); + excel2.setName("b试剂"); + excel2.setManufacturer("a厂家"); + excel2.setSimpleType("血清"); + excel2.setOperationSteps("血清的操作步骤"); + excel2.setResultDeterminationMethod("血清的结果判定"); + ExcelUtil.export(response, "试剂导入模板", "试剂数据", list, ReagentExcel.class); + } } diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RepairApplicationController.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RepairApplicationController.java index 711e93c..39acb73 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RepairApplicationController.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/controller/RepairApplicationController.java @@ -50,9 +50,14 @@ public class RepairApplicationController extends BladeController { wrapper.eq(RepairApplication::getStatus, repairApplication.getStatus()); } if (repairApplication.getName() != null && !"".equals(repairApplication.getName())) { - wrapper.like(RepairApplication::getCode, repairApplication.getName()).or(); - wrapper.like(RepairApplication::getName, repairApplication.getName()).or(); - wrapper.like(RepairApplication::getType, repairApplication.getName()); + wrapper.and(qw -> qw + .like(RepairApplication::getCode, repairApplication.getName()).or() + .like(RepairApplication::getName, repairApplication.getName()).or() + .like(RepairApplication::getType, repairApplication.getName()) + ); + } + if (repairApplication.getStartTime() != null && repairApplication.getEndTime() != null) { + wrapper.between(RepairApplication::getCreateTime, repairApplication.getStartTime(), repairApplication.getEndTime()); } wrapper.orderByDesc(RepairApplication::getCreateTime); IPage page = repairApplicationService.page(Condition.getPage(query), wrapper); diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/excel/ReagentExcel.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/excel/ReagentExcel.java new file mode 100644 index 0000000..f855826 --- /dev/null +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/excel/ReagentExcel.java @@ -0,0 +1,34 @@ +package org.springblade.lims.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ReagentExcel implements Serializable { + + private static final long serialVersionUID = 1L; + + @ColumnWidth(20) + @ExcelProperty("试剂名称") + private String name; + + @ColumnWidth(20) + @ExcelProperty("生产厂家") + private String manufacturer; + + @ColumnWidth(20) + @ExcelProperty("样品类型") + private String simpleType; + + @ColumnWidth(20) + @ExcelProperty("操作步骤") + private String operationSteps; + + @ColumnWidth(20) + @ExcelProperty("结果判定方法") + private String resultDeterminationMethod; + +} diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/feign/LimsClient.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/feign/LimsClient.java new file mode 100644 index 0000000..23a9b9a --- /dev/null +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/feign/LimsClient.java @@ -0,0 +1,29 @@ + +package org.springblade.lims.feign; + +import lombok.AllArgsConstructor; +import org.springblade.core.tenant.annotation.NonDS; +import org.springblade.core.tool.api.R; +import org.springblade.lims.entry.Instrument; +import org.springblade.lims.service.IInstrumentService; +import org.springframework.web.bind.annotation.RestController; + +/** + * 用户服务Feign实现类 + * @author Chill + */ +@NonDS +@RestController +@AllArgsConstructor +public class LimsClient implements ILimsClient { + + private final IInstrumentService instrumentService; + + @Override + public R updateStatus(String instrumentId) { + Instrument instrument = new Instrument(); + instrument.setId(Long.valueOf(instrumentId)); + instrument.setStatus(1); + return R.status(instrumentService.updateById(instrument)); + } +} diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IEntrtrustService.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IEntrtrustService.java index 07bf73c..ab4f063 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IEntrtrustService.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/IEntrtrustService.java @@ -37,4 +37,6 @@ public interface IEntrtrustService extends BaseService { void simpleReceivePrint(String id, HttpServletResponse response); void examineReportPrint(String id, HttpServletResponse response); + + void repairPrint(String id, HttpServletResponse response); } 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 aeb8967..721e53d 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 @@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.NoArgsConstructor; import org.apache.commons.lang3.RandomUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.springblade.common.utils.ZipCompressUtil; import org.springblade.core.tool.api.R; import org.springblade.lims.entry.*; import org.springblade.lims.excel.ExamineTemplate2Excel; @@ -29,6 +31,7 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.HttpURLConnection; @@ -88,6 +91,8 @@ public class EntrustServiceImpl extends BaseServiceImpl private EntrustCustomerServiceImpl customerService; @Autowired private IContractService contractService; + @Autowired + private IRepairApplicationService repairApplicationService; @Value("${handleUrl}") private String handleUrl; @@ -158,22 +163,34 @@ public class EntrustServiceImpl extends BaseServiceImpl @Value("${simpleReceivePrint}") private String simpleReceivePrint; - List> resultList2 = new ArrayList<>(); + @Value("${repairPrint}") + private String repairPrint; + + @Override @Transactional(rollbackFor = Exception.class) public Entrust addEntrust(Entrust entrust) { - // 如果是追加检测项目 - if (entrust.getOperatType() != null && "1".equals(entrust.getOperatType())) { - entrust.setEntrustStatus("2.1"); - this.updateById(entrust); - return entrust; - } long id = RandomUtils.nextLong(); // 送检单位、采样单位之类的,如果没有就新增 addIfNull(entrust); + // 新增或修改 检测集合 + addOrUpdateExamines(entrust.getExamines(), entrust, id); + + // 如果是修改 + if (entrust.getOperatType() != null && "1".equals(entrust.getOperatType())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(Examine::getEntrustId, entrust.getId()); + List examines = examineService.list(wrapper); + if (examines.size() < entrust.getExamines().size()) { + entrust.setEntrustStatus("2.1"); + } + this.updateById(entrust); + return entrust; + } + // 样品关联数据入库 entrust = addSimpleRel(entrust, id); @@ -183,8 +200,6 @@ public class EntrustServiceImpl extends BaseServiceImpl // 委托单入库/修改 addOrUpdateEntrust(entrust, id); - // 新增或修改 检测集合 - addOrUpdateExamines(entrust.getExamines(), entrust); return entrust; } @@ -348,17 +363,38 @@ public class EntrustServiceImpl extends BaseServiceImpl // 根据检测的数量判断用按个模板 switch (examineCount) { - case 1: currTemplate = print1; break; - case 2: currTemplate = print2; break; - case 3: currTemplate = print3; break; - case 4: currTemplate = print4; break; - case 5: currTemplate = print5; break; - case 6: currTemplate = print6; break; - case 7: currTemplate = print7; break; - case 8: currTemplate = print8; break; - case 9: currTemplate = print9; break; - case 10: currTemplate = print10; break; - default: currTemplate = print10; + case 1: + currTemplate = print1; + break; + case 2: + currTemplate = print2; + break; + case 3: + currTemplate = print3; + break; + case 4: + currTemplate = print4; + break; + case 5: + currTemplate = print5; + break; + case 6: + currTemplate = print6; + break; + case 7: + currTemplate = print7; + break; + case 8: + currTemplate = print8; + break; + case 9: + currTemplate = print9; + break; + case 10: + currTemplate = print10; + break; + default: + currTemplate = print10; } List resultList = new ArrayList<>(); @@ -423,7 +459,8 @@ public class EntrustServiceImpl extends BaseServiceImpl List list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class); if (list != null && list.size() > 0) { for (XN2Excel excel : list) { - ExamineResultVo resultVo = new ExamineResultVo(); LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + ExamineResultVo resultVo = new ExamineResultVo(); + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); wrapper1.eq(Simple::getEntrustId, id); wrapper1.eq(Simple::getExperieNum, excel.getExperieNum()); Simple simple = simpleService.getOne(wrapper1); @@ -915,7 +952,7 @@ public class EntrustServiceImpl extends BaseServiceImpl public void reportPrint(String examineId, HttpServletResponse response) { Map result = new HashMap<>(); List> resultList1 = new ArrayList<>(); - + List> resultList2 = new ArrayList<>(); String url = ""; // 检测数据 Examine examine = examineService.getById(examineId); @@ -972,19 +1009,19 @@ public class EntrustServiceImpl extends BaseServiceImpl String batchNos = examineResult.getBatchNos(); String[] split3 = batchNos.split(","); Map> tempListMap = new HashMap(); - for (String batch : split3) { + for (String batch : split3) { String reagentId = batch.split("-")[0]; - String realBatch = batch.split("-")[1]; - List list = tempListMap.get(reagentId); - if (CollectionUtils.isNotEmpty(list)) { - list.add(realBatch); - } else { - List temp = new ArrayList<>(); - temp.add(realBatch); - tempListMap.put(reagentId, temp); - } + String realBatch = batch.split("-")[1]; + List list = tempListMap.get(reagentId); + if (CollectionUtils.isNotEmpty(list)) { + list.add(realBatch); + } else { + List temp = new ArrayList<>(); + temp.add(realBatch); + tempListMap.put(reagentId, temp); + } } - String resultBatchStr = ""; + String resultBatchStr = ""; // 遍历处理批号 Set strings = tempListMap.keySet(); for (String reagentId : strings) { @@ -1351,8 +1388,19 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("10", "10"); map.put("11", "11"); map.put("12", "12"); - } - else { + map.put("13", "1"); + map.put("14", "2"); + map.put("15", "3"); + map.put("16", "4"); + map.put("17", "5"); + map.put("18", "6"); + map.put("19", "7"); + map.put("20", "8"); + map.put("21", "9"); + map.put("22", "10"); + map.put("23", "11"); + map.put("24", "12"); + } else { if (j == 1) { map.put("0", "A"); } @@ -1377,29 +1425,39 @@ public class EntrustServiceImpl extends BaseServiceImpl if (j == 8) { map.put("0", "H"); } - map.put("1", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("2", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("3", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("4", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("5", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("6", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("7", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("8", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("9", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("10", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("11", list.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("12", list.get(start + (8 * x + j) - 1).getValue()); + 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(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + map.put((k + 12) + "", num.split("-")[2]); + } else { + map.put((k + 12) + "", " "); + } + x++; + } +// map.put("1", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("2", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("3", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("4", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("5", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("6", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("7", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("8", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("9", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("10", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("11", list.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("12", list.get(start + (8 * x + j) - 1).getValue()); } resultList2.add(map); } @@ -1517,8 +1575,19 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("10", "10"); map.put("11", "11"); map.put("12", "12"); - } - else { + map.put("13", "1"); + map.put("14", "2"); + map.put("15", "3"); + map.put("16", "4"); + map.put("17", "5"); + map.put("18", "6"); + map.put("19", "7"); + map.put("20", "8"); + map.put("21", "9"); + map.put("22", "10"); + map.put("23", "11"); + map.put("24", "12"); + } else { if (j == 1) { map.put("0", "A"); } @@ -1543,29 +1612,39 @@ public class EntrustServiceImpl extends BaseServiceImpl if (j == 8) { map.put("0", "H"); } - map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); + 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(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + map.put((k + 12) + "", num.split("-")[2]); + } else { + map.put((k + 12) + "", " "); + } + x++; + } +// map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); } resultList2.add(map); } @@ -1683,8 +1762,19 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("10", "10"); map.put("11", "11"); map.put("12", "12"); - } - else { + map.put("13", "1"); + map.put("14", "2"); + map.put("15", "3"); + map.put("16", "4"); + map.put("17", "5"); + map.put("18", "6"); + map.put("19", "7"); + map.put("20", "8"); + map.put("21", "9"); + map.put("22", "10"); + map.put("23", "11"); + map.put("24", "12"); + } else { if (j == 1) { map.put("0", "A"); } @@ -1709,29 +1799,39 @@ public class EntrustServiceImpl extends BaseServiceImpl if (j == 8) { map.put("0", "H"); } - map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); - x++; - map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); + 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(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + map.put((k + 12) + "", num.split("-")[2]); + } else { + map.put((k + 12) + "", " "); + } + x++; + } +// map.put("1", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("2", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("3", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("4", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("5", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("6", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("7", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("8", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("9", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("10", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("11", arrVOList.get(start + (8 * x + j) - 1).getValue()); +// x++; +// map.put("12", arrVOList.get(start + (8 * x + j) - 1).getValue()); } resultList2.add(map); } @@ -1747,21 +1847,24 @@ public class EntrustServiceImpl extends BaseServiceImpl double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); String format = df.format((a1 + b1) / 2); - list.get(i * 96).setNum("阴性对照平均OD值"); - list.get(i * 96).setValue(format); - list.get(i * 96).setResult(" "); - list1.add(list.get(i * 96)); + ExamineDataArrVO arrVO = new ExamineDataArrVO(); + arrVO.setNum("阴性对照平均OD值"); + arrVO.setValue(format); + arrVO.setResult(" "); + list1.add(arrVO); double a2 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); double b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); String format1 = df.format((a2 + b2) / 2); - list.get((i * 96) + 1).setNum("阳性对照平均OD值"); - list.get((i * 96) + 1).setValue(format1); - list.get((i * 96) + 1).setResult(" "); - list1.add(list.get((i * 96) + 1)); + ExamineDataArrVO arrVO1 = new ExamineDataArrVO(); + arrVO1.setNum("阳性对照平均OD值"); + arrVO1.setValue(format1); + arrVO1.setResult(" "); + list1.add(arrVO1); for (int j = 0; j < 96; j++) { - if (j > 5) { - list1.add(list.get((i * 96) + j)); + ExamineDataArrVO vo = list.get((i * 96) + j); + if (vo.getNum() != null && !"".equals(vo.getNum())) { + list1.add(vo); } } } @@ -1770,24 +1873,27 @@ public class EntrustServiceImpl extends BaseServiceImpl double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); String format = df.format((a1 + b1) / 2); - list.get(i * 96).setNum("阴性对照平均OD值"); - list.get(i * 96).setValue(format); - list.get(i * 96).setResult(" "); - list1.add(list.get(i * 96)); + ExamineDataArrVO arrVO = new ExamineDataArrVO(); + arrVO.setNum("阴性对照平均OD值"); + arrVO.setValue(format); + arrVO.setResult(" "); + list1.add(arrVO); double a2 = Double.parseDouble(list.get((i * 96) + 2).getOriginResult()); double b2 = Double.parseDouble(list.get((i * 96) + 3).getOriginResult()); String format1 = df.format((a2 + b2) / 2); - list.get((i * 96) + 1).setNum("阳性对照平均OD值"); - list.get((i * 96) + 1).setValue(format1); - list.get((i * 96) + 1).setResult(" "); - list1.add(list.get((i * 96) + 1)); + ExamineDataArrVO arrVO1 = new ExamineDataArrVO(); + arrVO1.setNum("阳性对照平均OD值"); + arrVO1.setValue(format1); + arrVO1.setResult(" "); + list1.add(arrVO1); for (int j = 0; j < 96; j++) { if ((i * 96) + j > list.size() - 1) { break; } - if (j > 5) { - list1.add(list.get((i * 96) + j)); + ExamineDataArrVO vo = list.get((i * 96) + j); + if (vo.getNum() != null && !"".equals(vo.getNum())) { + list1.add(vo); } } } @@ -1810,7 +1916,8 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("result3", list1.get(list1.size() / 3 * 2 + i).getResult()); resultList1.add(map); } - } else { + } + else { for (int i = 0; i < list1.size() / 3 + 1; i++) { if (list1.size() % 3 == 1) { @@ -1847,7 +1954,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++) { int start = i * 96; @@ -1871,6 +1978,18 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("10", "10"); map.put("11", "11"); map.put("12", "12"); + map.put("13", "1"); + map.put("14", "2"); + map.put("15", "3"); + map.put("16", "4"); + map.put("17", "5"); + map.put("18", "6"); + map.put("19", "7"); + map.put("20", "8"); + map.put("21", "9"); + map.put("22", "10"); + map.put("23", "11"); + map.put("24", "12"); } else { if (j == 1) { map.put("0", "A"); @@ -1896,53 +2015,71 @@ public class EntrustServiceImpl extends BaseServiceImpl if (j == 8) { map.put("0", "H"); } - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); - } - x++; - if (list.size() - 1 >= start + (8 * x + j) - 1) { - map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); - } + 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 (num != null && !"".equals(num) && num.split("-").length == 3) { + map.put((k + 12) + "", num.split("-")[2]); + } else { + map.put((k + 12) + "", " "); + } + } + x++; + } +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); +// String num = list.get(start + (8 * x + j) - 1).getNum(); +// if (num != null && !"".equals(num) && num.split("-").length == 3) { +// map.put("13", num.split("-")[2]); +// } else { +// map.put("13", " "); +// } +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } +// x++; +// if (list.size() - 1 >= start + (8 * x + j) - 1) { +// map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); +// } } resultList2.add(map); } @@ -1970,6 +2107,18 @@ public class EntrustServiceImpl extends BaseServiceImpl map.put("10", "10"); map.put("11", "11"); map.put("12", "12"); + map.put("13", "1"); + map.put("14", "2"); + map.put("15", "3"); + map.put("16", "4"); + map.put("17", "5"); + map.put("18", "6"); + map.put("19", "7"); + map.put("20", "8"); + map.put("21", "9"); + map.put("22", "10"); + map.put("23", "11"); + map.put("24", "12"); } else { if (j == 1) { map.put("0", "A"); @@ -1995,29 +2144,39 @@ public class EntrustServiceImpl extends BaseServiceImpl if (j == 8) { map.put("0", "H"); } - map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); - x++; - map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); + 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(); + if (num != null && !"".equals(num) && num.split("-").length == 3) { + map.put((k + 12) + "", num.split("-")[2]); + } else { + map.put((k + 12) + "", " "); + } + x++; + } +// map.put("1", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("2", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("3", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("4", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("5", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("6", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("7", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("8", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("9", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("10", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("11", list.get(start + (8 * x + j) - 1).getOriginResult()); +// x++; +// map.put("12", list.get(start + (8 * x + j) - 1).getOriginResult()); } resultList2.add(map); } @@ -2778,8 +2937,7 @@ public class EntrustServiceImpl extends BaseServiceImpl } } } - } - else { + } else { for (int i = 0; i < list.size() / 96 + 1; i++) { double a1 = Double.parseDouble(list.get(i * 96).getOriginResult()); double b1 = Double.parseDouble(list.get((i * 96) + 1).getOriginResult()); @@ -2873,6 +3031,108 @@ public class EntrustServiceImpl extends BaseServiceImpl } } + @Override + public void repairPrint(String id, HttpServletResponse response) { + String dateStamp = new java.text.SimpleDateFormat("yyyyMMddHHmmss").format(new Date()); + String srcPathName = "C://Users//AAA//Desktop//shuojin//" + dateStamp; + String outputFile = "C://Users//AAA//Desktop//shuojin//" + dateStamp + ".zip"; + File file = new File(srcPathName); + //如果文件夹不存在,创建文件夹 + if(!file.exists()){ + file.mkdir(); + } + XWPFDocument doc = null; + FileOutputStream fos = null; + String[] repairIds = id.split(","); + for (String repairId : repairIds) { + Map result = new HashMap<>(); + SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日"); + RepairApplication repair = repairApplicationService.getById(repairId); + result.put("1", repair.getCode()); + result.put("2", repair.getApplyRepairDept()); + result.put("3", repair.getName()); + result.put("4", repair.getCode()); + result.put("5", repair.getManufacturer()); + result.put("6", repair.getVersion()); + result.put("7", format.format(repair.getProductionDate())); + result.put("8", format.format(repair.getEnableDate())); + result.put("9", repair.getFaultPhenomenon()); + result.put("10", repair.getApplyUserName()); + result.put("11", repair.getApplyDeptUserName()); + result.put("12", format.format(repair.getApplyDate())); + result.put("13", repair.getReviewComments()); + result.put("14", repair.getBusinessOfficeName()); + result.put("15", format.format(repair.getReviewDate())); + result.put("16", repair.getApprovalComments()); + result.put("17", repair.getCenterDirectorName()); + result.put("18", format.format(repair.getApplyDate())); + result.put("19", repair.getMaintenanceRecord()); + result.put("20", repair.getMaintainer()); + result.put("21", format.format(repair.getMaintainerDate())); + result.put("22", repair.getWorkingHours()); + result.put("23", repair.getLaborCost()); + result.put("24", repair.getMaterialCost()); + result.put("25", repair.getTotalCost()); + result.put("26", repair.getAcceptedName()); + result.put("27", format.format(repair.getAcceptedDate())); + result.put("28", repair.getRemark()); + result.put("29", repair.getUserComments()); + try { + doc = WordExportUtil.exportWord07(repairPrint, result); + fos = new FileOutputStream(srcPathName + "//" + repair.getName() + "报修申请表.docx"); + } catch (Exception e) { + e.printStackTrace(); + } finally { + if (null != doc) { + try { + doc.write(fos); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != fos) { + try { + fos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + if (null != doc) { + try { + doc.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + ZipCompressUtil.compress(srcPathName, outputFile); + + // 返回文件流给前端 + response.setContentType("application/x-msdownload;"); + response.setHeader("Content-disposition", "attachment;filename=" + dateStamp + ".zip"); + //注:如果返回content-length的时候,先复制一下输入流,此时记录文件长度,返回复制之后的文件流 + File file1 = new File(outputFile); + try { + InputStream stream = new FileInputStream(file1); + + ServletOutputStream out = response.getOutputStream(); + + byte buff[] = new byte[1024]; + + int length = 0; + + while ((length = stream.read(buff)) > 0) { + out.write(buff,0,length); + } + stream.close(); + out.close(); + out.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + } + /** * 根据网络图片URL转成字节数组(弃用) */ @@ -2993,7 +3253,7 @@ public class EntrustServiceImpl extends BaseServiceImpl // 委托单内容补充 entrust.setSimpleName(simpleName.toString()); entrust.setSimpleCount(simpleCount); - String originalNum = "01-" + fullByZero(simpleCount); + String originalNum = "01-" + fullByZero(simpleCount); entrust.setIsDeleted(0); entrust.setCreateUser(null); @@ -3053,7 +3313,7 @@ public class EntrustServiceImpl extends BaseServiceImpl /** * 新增或修改检验集合 */ - private void addOrUpdateExamines(List examines, Entrust entrust) { + private void addOrUpdateExamines(List examines, Entrust entrust, Long id) { if (CollectionUtils.isNotEmpty(examines)) { List saveList = new ArrayList<>(); List updateList = new ArrayList<>(); @@ -3067,7 +3327,11 @@ public class EntrustServiceImpl extends BaseServiceImpl examine.setSimpleCount(0); examine.setExperieNum(""); examine.setExamineOrder(i + 1); - examine.setEntrustId(entrust.getId()); + if (entrust.getId() != null) { + examine.setEntrustId(entrust.getId()); + } else { + examine.setEntrustId(id); + } examine.setAcceptanceNum(entrust.getAcceptanceNum()); examine.setCreateTime(new Date()); examine.setUpdateTime(new Date()); @@ -3086,11 +3350,13 @@ public class EntrustServiceImpl extends BaseServiceImpl private void addUseCount(int type, Long elementId) { System.out.println("type:" + type); System.out.println("elementId: " + elementId); - if (elementId == null) { return; } + if (elementId == null) { + return; + } if (type == 1) { ExamineItem examineItem = examineItemService.getById(elementId); Integer useCount = examineItem.getUseCount(); - examineItem.setUseCount(++ useCount); + examineItem.setUseCount(++useCount); examineItemService.updateById(examineItem); } if (type == 2) { diff --git a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java index e195697..8fffda4 100644 --- a/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java +++ b/lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/TaskBlueprintServiceImpl.java @@ -84,6 +84,13 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl examines = eTask.getExamines(); + String simpleCurrPlace = ""; + for (Examine examine : examines) { + if (examine.getSimpleCurrPlace() != null && !"".equals(examine.getSimpleCurrPlace())) { + simpleCurrPlace = examine.getSimpleCurrPlace(); + break; + } + } for (Examine examine : examines) { if (!"".equals(examine.getExperieNum())) { continue; @@ -112,6 +119,7 @@ public class TaskBlueprintServiceImpl extends BaseServiceImpl