2022年9月6日

pull/1/head
litao 4 years ago
parent 3100b478a2
commit dcaac3971a
  1. 6
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Entrust.java
  2. 6
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Examine.java
  3. 6
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/Reagent.java
  4. 16
      lab-service-api/lab-lims-api/src/main/java/org/springblade/lims/entry/TypeAndOperation.java
  5. 163
      lab-service-api/lab-system-api/lab-system-api.iml
  6. 7
      lab-service/lab-capital/pom.xml
  7. 10
      lab-service/lab-capital/src/main/java/org/springblade/lims/goods/controller/ApplyController.java
  8. 346
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/EntrustController.java
  9. 33
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineController.java
  10. 6
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineItemController.java
  11. 13
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ExamineResultController.java
  12. 13
      lab-service/lab-lims/src/main/java/org/springblade/lims/controller/ReagentController.java
  13. 553
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/EntrustServiceImpl.java
  14. 14
      lab-service/lab-lims/src/main/java/org/springblade/lims/service/impl/ExamineResultServiceImpl.java
  15. 1
      lab-service/lab-user/src/main/java/org/springblade/system/user/controller/UserController.java

@ -50,6 +50,9 @@ public class Entrust extends BaseEntity implements Serializable {
// 3.送检单位
public String entrustCustomerName;
// 20.送检人
public String submittedBy;
// 4.邮编
public String postalCode;
@ -105,8 +108,7 @@ public class Entrust extends BaseEntity implements Serializable {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
public Date expectFinishedTime;
// 20.送检人
public String submittedBy;
// 21.接样员id
public String sampleReceiverId;

@ -219,4 +219,10 @@ public class Examine extends BaseEntity implements Serializable {
private String inputMode;
private String examineStatus;
/**
* 样品状态
*/
@TableField(exist = false)
private String simpleStatus;
}

@ -60,7 +60,11 @@ public class Reagent extends BaseEntity implements Serializable {
private String instrumentName;
@TableField(exist = false)
List<Instrument> instrumentList;
private List<Instrument> instrumentList;
private String typeAndOperation;
@TableField(exist = false)
private List<TypeAndOperation> operationList;
}

@ -0,0 +1,16 @@
package org.springblade.lims.entry;
import lombok.Data;
/**
* @author swj
* @date 2022年6月2日15:34:17
*/
@Data
public class TypeAndOperation {
private String type;
private String operation;
}

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springblade:blade-starter-cache:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-core-tool:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-core-launch:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.22.Final" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-undertow:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.undertow:undertow-core:2.0.33.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.xnio:xnio-api:3.3.8.Final" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jboss.xnio:xnio-nio:3.3.8.Final" level="project" />
<orderEntry type="library" name="Maven: io.undertow:undertow-servlet:2.0.33.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.2.Final" level="project" />
<orderEntry type="library" name="Maven: io.undertow:undertow-websockets-jsr:2.0.33.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.websocket:jboss-websocket-api_1.1_spec:1.1.4.Final" level="project" />
<orderEntry type="library" name="Maven: jakarta.servlet:jakarta.servlet-api:4.0.4" level="project" />
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:30.0-jre" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:3.5.0" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" />
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" name="Maven: io.protostuff:protostuff-core:1.6.0" level="project" />
<orderEntry type="library" name="Maven: io.protostuff:protostuff-api:1.6.0" level="project" />
<orderEntry type="library" name="Maven: io.protostuff:protostuff-runtime:1.6.0" level="project" />
<orderEntry type="library" name="Maven: io.protostuff:protostuff-collectionschema:1.6.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.11.4" level="project" />
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-starter-auth:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-starter-jwt:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-redis:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-redis:2.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-keyvalue:2.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-oxm:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.lettuce:lettuce-core:5.2.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-common:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-handler:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-resolver:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-buffer:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-codec:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.netty:netty-transport:4.1.58.Final" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.3.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt-impl:0.11.2" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt-api:0.11.2" level="project" />
<orderEntry type="library" name="Maven: io.jsonwebtoken:jjwt-jackson:0.11.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.12.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.12.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.25" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.retry:spring-retry:1.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-starter-mybatis:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.2" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.2" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.2" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.2" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:4.0" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-typehandlers-jsr310:1.0.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.2.5" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.springblade:blade-starter-tenant:2.8.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.baomidou:dynamic-datasource-spring-boot-starter:3.3.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-openfeign:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.9.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.59" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.59" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-openfeign-core:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.13.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-ribbon:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-archaius:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form-spring:3.8.0" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign.form:feign-form:3.8.0" level="project" />
<orderEntry type="library" name="Maven: commons-fileupload:commons-fileupload:1.3.3" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:2.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.2.8.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-core:10.12" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-slf4j:10.12" level="project" />
<orderEntry type="library" name="Maven: io.github.openfeign:feign-hystrix:10.12" level="project" />
<orderEntry type="library" name="Maven: com.netflix.archaius:archaius-core:0.7.7" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-configuration:commons-configuration:1.8" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.netflix.hystrix:hystrix-core:1.5.18" level="project" />
<orderEntry type="library" name="Maven: io.reactivex:rxjava:1.3.8" level="project" />
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.9" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.10.5" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.10.5" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.10.5" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.19" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.10.5" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.10.5" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.10.5" level="project" />
<orderEntry type="library" name="Maven: io.github.classgraph:classgraph:4.1.7" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:2.0.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.12.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:2.0.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.3.1.Final" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.6.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.springblade:blade-core-auto:2.8.1.RELEASE" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.18" level="project" />
</component>
</module>

@ -127,6 +127,13 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>lab-system-api</artifactId>
<version>2.8.1.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-excel</artifactId>

@ -22,6 +22,7 @@ import org.springblade.resource.enums.SysTypeEnum;
import org.springblade.resource.feign.IMessageClient;
import org.springblade.system.cache.DictBizCache;
import org.springblade.system.enums.DictBizEnum;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.transaction.annotation.Transactional;
@ -49,6 +50,8 @@ public class ApplyController extends BladeController {
private final IMessageClient messageClient;
private final ISysClient sysClient;
/**
* 1.分页 申领列表
*/
@ -139,11 +142,14 @@ public class ApplyController extends BladeController {
*/
@PostMapping("/save")
public void save(@RequestBody ApplyVO applyVO) {
// 系统参数是否审批
String isApproval = sysClient.getParamValue("is_approval").getData();
//添加申领表
Apply apply = BeanUtil.copy(applyVO, Apply.class);
apply.setApplyTime(new Date());
apply.setApplyUserId(AuthUtil.getUserId());
apply.setApplyUser(AuthUtil.getUserName());
String realName = userClient.userInfoById(AuthUtil.getUserId()).getData().getRealName();
apply.setApplyUser(realName);
apply.setIsUpdate(-1);
// apply.setCode(UuidUtils.generateUuid());
apply.setCode("编码格式待定");
@ -176,7 +182,6 @@ public class ApplyController extends BladeController {
}
//保证新插入
applyDetail.setId(null);
applyDetailService.save(applyDetail);
//扣库存
Goods goods = goodsService.getById(applyDetail.getProductId());
if (goods != null) {
@ -184,6 +189,7 @@ public class ApplyController extends BladeController {
goodsService.updateById(goods);
}
}
applyDetailService.saveBatch(detailList);
}
}

@ -39,6 +39,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
@ -473,291 +474,94 @@ public class EntrustController extends BladeController {
public R<Map<String, Object>> getEntrust(String id, String roleId, String deptId, String userId) {
HashMap<String, Object> map = new HashMap<>();
// TODO 查看详情需要改动
//科室主任
if ("1123598816738675203".equals(roleId)) {
//委托单
Entrust entrust = service.getById(id);
if (entrust.getSampleReceiverId() != null) {
R<User> userR = userClient.userInfoById(Long.valueOf(entrust.getSampleReceiverId()));
User data = userR.getData();
entrust.setSampleReceiverName(data.getName());
}
//委托单
Entrust entrust = service.getById(id);
if (entrust.getSampleReceiverId() != null) {
R<User> userR = userClient.userInfoById(Long.valueOf(entrust.getSampleReceiverId()));
User data = userR.getData();
entrust.setSampleReceiverName(data.getName());
}
//样品
List<Simple> simpleList = null;
if (entrust != null) {
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Simple::getEntrustId, entrust.getId());
simpleList = simpleService.list(wrapper);
}
//样品
List<Simple> simpleList = null;
if (entrust != null) {
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Simple::getEntrustId, entrust.getId());
simpleList = simpleService.list(wrapper);
}
//计划书
QueryWrapper<TaskBlueprint> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entrust_id", id);
TaskBlueprint taskBlueprint = blueprintService.getOne(queryWrapper);
//任务
List<ETask> eTaskList = new ArrayList<>();
if (taskBlueprint != null) {
QueryWrapper<ETask> wrapper1 = new QueryWrapper<>();
wrapper1.eq("task_blueprint_id", taskBlueprint.getId());
// if ("1536303217085018114".equals(deptId)) {
// wrapper1.eq("dept_id", deptId);
// }
// if ("1536303261238456322".equals(deptId)) {
// wrapper1.eq("dept_id", deptId);
// }
// if ("1536303317815422978".equals(deptId)) {
// wrapper1.eq("dept_id", deptId);
// }
List<ETask> eTasks = eTaskService.list(wrapper1);
if (eTasks != null && eTasks.size() > 0) {
for (ETask eTask : eTasks) {
LambdaQueryWrapper<Examine> examineLambdaQueryWrapper = new LambdaQueryWrapper<>();
examineLambdaQueryWrapper.eq(Examine::getETaskId, eTask.getId());
List<Examine> examines = examineService.list(examineLambdaQueryWrapper);
if (examines != null && examines.size() > 0) {
List<Examine> examineList = new ArrayList<>();
for (Examine examine : examines) {
if (examine.getExperieNum() != null && !"".equals(examine.getExperieNum())) {
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
if (examineItem != null) {
examine.setExamineItemName(examineItem.getName());
}
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
if (examineWay != null) {
examine.setExamineWayName(examineWay.getName());
}
ExamineBasis examineBasis = examineBasisService.getById(examine.getExamineBasisId());
if (examineBasis != null) {
examine.setExamineBasisName(examineBasis.getName());
}
if (examine.getExamineBy() != null && !"".equals(examine.getExamineBy())) {
R<User> userR = userClient.userInfoById(Long.valueOf(examine.getExamineBy()));
User user = userR.getData();
if (user != null) {
examine.setExamineByName(user.getName());
}
}
examineList.add(examine);
//计划书
QueryWrapper<TaskBlueprint> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entrust_id", id);
TaskBlueprint taskBlueprint = blueprintService.getOne(queryWrapper);
//任务
List<ETask> eTaskList = new ArrayList<>();
if (taskBlueprint != null) {
QueryWrapper<ETask> wrapper1 = new QueryWrapper<>();
wrapper1.eq("task_blueprint_id", taskBlueprint.getId());
List<ETask> eTasks = eTaskService.list(wrapper1);
if (eTasks != null && eTasks.size() > 0) {
for (ETask eTask : eTasks) {
LambdaQueryWrapper<Examine> examineLambdaQueryWrapper = new LambdaQueryWrapper<>();
examineLambdaQueryWrapper.eq(Examine::getETaskId, eTask.getId());
List<Examine> examines = examineService.list(examineLambdaQueryWrapper);
if (examines != null && examines.size() > 0) {
List<Examine> examineList = new ArrayList<>();
for (Examine examine : examines) {
if (examine.getExperieNum() != null && !"".equals(examine.getExperieNum())) {
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
if (examineItem != null) {
examine.setExamineItemName(examineItem.getName());
}
}
eTask.setExamines(examineList);
if (eTask.getSimpleReceiver() != null && !eTask.getSimpleReceiver().equals("")) {
R<User> userR = userClient.userInfoById(Long.valueOf(eTask.getSimpleReceiver()));
User data = userR.getData();
if (data != null) {
eTask.setSimpleReceiverName(data.getName());
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
if (examineWay != null) {
examine.setExamineWayName(examineWay.getName());
}
ExamineBasis examineBasis = examineBasisService.getById(examine.getExamineBasisId());
if (examineBasis != null) {
examine.setExamineBasisName(examineBasis.getName());
}
if (examine.getExamineBy() != null && !"".equals(examine.getExamineBy())) {
R<User> userR = userClient.userInfoById(Long.valueOf(examine.getExamineBy()));
User user = userR.getData();
if (user != null) {
examine.setExamineByName(user.getName());
}
}
examineList.add(examine);
}
if (examineList != null && examineList.size() > 0) {
eTaskList.add(eTask);
}
eTask.setExamines(examineList);
if (eTask.getSimpleReceiver() != null && !eTask.getSimpleReceiver().equals("")) {
R<User> userR = userClient.userInfoById(Long.valueOf(eTask.getSimpleReceiver()));
User data = userR.getData();
if (data != null) {
eTask.setSimpleReceiverName(data.getName());
}
}
if (examineList != null && examineList.size() > 0) {
eTaskList.add(eTask);
}
}
taskBlueprint.setTasks(eTaskList);
}
taskBlueprint.setTasks(eTaskList);
}
}
//检测数据
// List<Examine> examineList = new ArrayList<>();
// if (eTaskList != null && eTaskList.size() > 0) {
// eTaskList.forEach(item -> {
// QueryWrapper<Examine> examineQueryWrapper = new QueryWrapper<>();
// examineQueryWrapper.eq("e_task_id", item.getId());
// List<Examine> list1 = examineService.list(examineQueryWrapper);
// item.setExamines(list1);
// examineList.addAll(list1);
// });
// }
//已分配的检测数据
// List<Examine> examineList = new ArrayList<>();
// LambdaQueryWrapper<Examine> examineLambdaQueryWrapper = new LambdaQueryWrapper<>();
// examineLambdaQueryWrapper.eq(Examine::getEntrustId, id);
// examineLambdaQueryWrapper.eq(Examine::getDeptId, deptId);
// List<Examine> examines = examineService.list(examineLambdaQueryWrapper);
// for (Examine examine1 : examines) {
// if (examine1.getExperieNum() != null) {
// examineList.add(examine1);
// }
// }
//实验室主任
//带接样
if ("1".equals(entrust.getEntrustStatus())) {
map.put("entrust", entrust);
return R.data(map);
}
//待计划
if ("2".equals(entrust.getEntrustStatus())) {
map.put("entrust", entrust);
map.put("simple", simpleList);
return R.data(map);
}
if ("1".equals(entrust.getEntrustStatus())) {
map.put("entrust", entrust);
map.put("simple", simpleList);
map.put("taskBlueprint", taskBlueprint);
return R.data(map);
//组长
// if ("1432876219952791554".equals(roleId)) {
// //科室一
// if ("1536303217085018114".equals(deptId)) {
// LambdaQueryWrapper<ETask> eTaskLambdaQueryWrapper = new LambdaQueryWrapper<>();
// eTaskLambdaQueryWrapper.eq(ETask::getDeptId, deptId);
// eTaskLambdaQueryWrapper.eq(ETask::getTaskBlueprintId, taskBlueprint.getId());
// ETask eTask = eTaskService.getOne(eTaskLambdaQueryWrapper);
// //待分配
// if (eTask.getStatus() == 0) {
// map.put("taskBlueprint", taskBlueprint);
// return R.data(map);
// }
//
// //已分配/检测中
// if (eTask.getStatus() == 1) {
// List<ETask> tasks = taskBlueprint.getTasks();
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
//
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
// //科室二
// if ("1536303261238456322".equals(deptId)) {
// LambdaQueryWrapper<ETask> eTaskLambdaQueryWrapper = new LambdaQueryWrapper<>();
// eTaskLambdaQueryWrapper.eq(ETask::getDeptId, deptId);
// eTaskLambdaQueryWrapper.eq(ETask::getTaskBlueprintId, taskBlueprint.getId());
// ETask eTask = eTaskService.getOne(eTaskLambdaQueryWrapper);
// //待分配
// if (eTask.getStatus() == 0) {
// map.put("taskBlueprint", taskBlueprint);
// return R.data(map);
// }
//
// //已分配/检测中
// if (eTask.getStatus() == 1) {
// List<ETask> tasks = taskBlueprint.getTasks();
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
//
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
// //科室三
// if ("1536303317815422978".equals(deptId)) {
// LambdaQueryWrapper<ETask> eTaskLambdaQueryWrapper = new LambdaQueryWrapper<>();
// eTaskLambdaQueryWrapper.eq(ETask::getDeptId, deptId);
// eTaskLambdaQueryWrapper.eq(ETask::getTaskBlueprintId, taskBlueprint.getId());
// ETask eTask = eTaskService.getOne(eTaskLambdaQueryWrapper);
// //待分配
// if (eTask.getStatus() == 0) {
// map.put("taskBlueprint", taskBlueprint);
// return R.data(map);
// }
//
// //已分配/检测中
// if (eTask.getStatus() == 1) {
// List<ETask> tasks = taskBlueprint.getTasks();
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
//
// map.put("taskBlueprint", taskBlueprint);
//// map.put("eTaskList", eTaskList);
// map.put("examine", examineList);
// return R.data(map);
// }
// }
}
//实验员
if ("1432876315142520834".equals(roleId) || "1542095624162525185".equals(roleId)) {
//检测表
Examine examine = examineService.getById(id);
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
if (examineItem != null) {
examine.setExamineItemName(examineItem.getName());
}
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
if (examineWay != null) {
examine.setExamineWayName(examineWay.getName());
}
ExamineBasis examineBasis = examineBasisService.getById(examine.getExamineBasisId());
if (examineBasis != null) {
examine.setExamineBasisName(examineBasis.getName());
}
if (!"".equals(examine.getExamineBy()) && examine.getExamineBy() != null) {
User user = userClient.userInfoById(Long.parseLong(examine.getExamineBy())).getData();
if (user != null) {
examine.setExamineByName(user.getName());
}
}
map.put("examine", examine);
//待计划
if ("2".equals(entrust.getEntrustStatus())) {
map.put("entrust", entrust);
map.put("simple", simpleList);
return R.data(map);
// //已分配的检测数据
// List<Examine> examineList = new ArrayList<>();
// LambdaQueryWrapper<Examine> examineLambdaQueryWrapper = new LambdaQueryWrapper<>();
// examineLambdaQueryWrapper.eq(Examine::getEntrustId, examine.getEntrustId());
// examineLambdaQueryWrapper.eq(Examine::getDeptId, deptId);
// List<Examine> examines = examineService.list(examineLambdaQueryWrapper);
// for (Examine examine1 : examines) {
// if (examine1.getExperieNum() != null) {
// ExamineItem examineItem = examineItemService.getById(examine1.getExamineItemId());
// if (examineItem != null) {
// examine1.setExamineItemName(examineItem.getName());
// }
// ExamineWay examineWay = examineWayService.getById(examine1.getExamineWayId());
// if (examineWay != null) {
// examine1.setExamineWayName(examineWay.getName());
// }
// ExamineBasis examineBasis = examineBasisService.getById(examine1.getExamineBasisId());
// if (examineBasis != null) {
// examine1.setExamineBasisName(examineBasis.getName());
// }
// if (examine1.getExamineBy() != null && !"".equals(examine1.getExamineBy())) {
// R<User> userR = userClient.userInfoById(Long.valueOf(examine1.getExamineBy()));
// User user = userR.getData();
// if (user != null) {
// examine1.setExamineByName(user.getName());
// }
// }
// examineList.add(examine1);
// }
// }
// //
// if (examineList != null && examineList.size() > 0) {
// for (Examine examine1 : examineList) {
// //检测结果表(有效)
// LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
// wrapper.eq(ExamineResult::getExamineId, examine1.getId());
// wrapper.eq(ExamineResult::getStatus, 1);
// ExamineResult examineResult = examineResultService.getOne(wrapper);
// //未完成
// if ("-1".equals(examine1.getIsFinished())) {
// map.put("examine", examineList);
// }
// //已完成
// if ("1".equals(examine1.getIsFinished())) {
// map.put("examine", examineList);
// if (examine1.getExamineBy().equals(userId)) {
// map.put("examineResult", examineResult);
// }
// }
// }
// return R.data(map);
// }
}
map.put("entrust", entrust);
map.put("simple", simpleList);
map.put("taskBlueprint", taskBlueprint);
return R.data(map);
}
@ -1497,7 +1301,7 @@ public class EntrustController extends BladeController {
@GetMapping("/acceptance")
public String acceptance(String number) throws ParseException {
//获取今年第一天
Date date = new Date();
LocalDateTime date = LocalDateTime.now();
int year = date.getYear();
String str = year + "-01-01 00:00:00";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
@ -1777,7 +1581,7 @@ public class EntrustController extends BladeController {
}
@GetMapping("/ceshi")
public void ceshi() {
public void ceshi() {
}

@ -111,6 +111,9 @@ public class ExamineController extends BladeController {
Map<String, Object> map = new HashMap<>();
//检验数据
Examine examine = examineService.getById(id);
Entrust entrust = service.getById(examine.getEntrustId());
examine.setSimpleStatus(entrust.getSimpleState());
if (examine != null) {
//实验项目
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
@ -181,6 +184,36 @@ public class ExamineController extends BladeController {
return map;
}
/**
* 查看详情
*/
@GetMapping("/detail")
public R<Map<String, Object>> detail(String id) {
HashMap<String, Object> map = new HashMap<>();
//检测表
Examine examine = examineService.getById(id);
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
if (examineItem != null) {
examine.setExamineItemName(examineItem.getName());
}
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
if (examineWay != null) {
examine.setExamineWayName(examineWay.getName());
}
ExamineBasis examineBasis = examineBasisService.getById(examine.getExamineBasisId());
if (examineBasis != null) {
examine.setExamineBasisName(examineBasis.getName());
}
if (!"".equals(examine.getExamineBy()) && examine.getExamineBy() != null) {
User user = userClient.userInfoById(Long.parseLong(examine.getExamineBy())).getData();
if (user != null) {
examine.setExamineByName(user.getName());
}
}
map.put("examine", examine);
return R.data(map);
}
/**
* 分配提交
*/

@ -118,7 +118,7 @@ public class ExamineItemController extends BladeController {
wayAndBase.setExamineBasisName(examineBasis.getName());
}
}
entry.setWayAndBasis(JSON.toJSONString(entry.getList()));
entry.setWayAndBasis(JSON.toJSONString(wayAndBases));
}
return R.data(service.updateById(entry));
}
@ -149,7 +149,7 @@ public class ExamineItemController extends BladeController {
wayAndBase.setExamineBasisName(examineBasis.getName());
}
}
entry.setWayAndBasis(JSON.toJSONString(entry.getList()));
entry.setWayAndBasis(JSON.toJSONString(wayAndBases));
}
entry.setCreateUser(null);
entry.setUpdateUser(null);
@ -189,6 +189,8 @@ public class ExamineItemController extends BladeController {
}
}
reagent.setInstrumentList(instrumentList);
List<TypeAndOperation> list = JSON.parseArray(reagent.getTypeAndOperation(), TypeAndOperation.class);
reagent.setOperationList(list);
reagentList.add(reagent);
}
}

@ -953,15 +953,24 @@ public class ExamineResultController extends BladeController {
List<PCR2Excel> read = ExcelUtil.read(file, PCR2Excel.class);
if (read != null && read.size() > 0) {
for (int i = 0; i < read.size(); i++) {
String ctValue = read.get(i).getCtValue();
String length = "";
if (ctValue != null && !"".equals(ctValue)) {
int length1 = 15 - ctValue.length();
for (int i1 = 0; i1 < length1; i1++) {
length += " ";
}
}
if (i == (read.size() - 1)) {
read.get(i).setCtValue(" " + read.get(i).getCtValue());
read.get(i).setCtValue(length + ctValue);
read.get(i).setValue(" 阳性");
} else {
if ("".equals(read.get(i).getCtValue()) || read.get(i).getCtValue() == null) {
read.get(i).setCtValue("/");
read.get(i).setValue("阴性");
} else {
read.get(i).setCtValue(" " + read.get(i).getCtValue());
read.get(i).setCtValue(length + ctValue);
read.get(i).setValue(" 阳性");
}
}

@ -1,6 +1,7 @@
package org.springblade.lims.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
@ -70,6 +71,10 @@ public class ReagentController extends BladeController {
}
reagent.setInstrumentList(instrumentList);
}
if (reagent.getTypeAndOperation() != null && !"".equals(reagent.getTypeAndOperation())) {
List<TypeAndOperation> list = JSON.parseArray(reagent.getTypeAndOperation(), TypeAndOperation.class);
reagent.setOperationList(list);
}
}
}
return R.data(page);
@ -81,6 +86,10 @@ public class ReagentController extends BladeController {
@PostMapping("/update")
@ApiOperation(value = "更改", notes = "更改")
public R update(@RequestBody Reagent entry) {
List<TypeAndOperation> operationList = entry.getOperationList();
if (operationList != null && operationList.size() > 0) {
entry.setTypeAndOperation(JSON.toJSONString(operationList));
}
return R.data(service.updateById(entry));
}
@ -97,6 +106,10 @@ public class ReagentController extends BladeController {
}
}
}
List<TypeAndOperation> operationList = entry.getOperationList();
if (operationList != null && operationList.size() > 0) {
entry.setTypeAndOperation(JSON.toJSONString(operationList));
}
return service.save(entry);
}

@ -300,155 +300,62 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
public void print(String id, HttpServletResponse response) {
//委托单
Entrust entrust = this.getById(id);
// 获取委托单下所有检测
LambdaQueryWrapper<Examine> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Examine::getEntrustId, id);
List<Examine> examineList = examineService.list(wrapper);
List<Simple> simpleList = null;
//样品
if (entrust != null) {
LambdaQueryWrapper<Simple> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Simple::getEntrustId, entrust.getId());
simpleList = simpleService.list(wrapper);
}
//计划书
QueryWrapper<TaskBlueprint> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("entrust_id", id);
TaskBlueprint taskBlueprint = blueprintService.getOne(queryWrapper);
List<ETask> eTaskList = null;
//任务
if (taskBlueprint != null) {
QueryWrapper<ETask> wrapper1 = new QueryWrapper<>();
wrapper1.eq("task_blueprint_id", taskBlueprint.getId());
eTaskList = eTaskService.list(wrapper1);
}
//检测数据
List<Examine> examineList = new ArrayList<>();
ExamineResult examineResult = null;
if (CollectionUtils.isNotEmpty(eTaskList)) {
eTaskList.forEach(item -> {
QueryWrapper<Examine> examineQueryWrapper = new QueryWrapper<>();
examineQueryWrapper.eq("e_task_id", item.getId());
List<Examine> list1 = examineService.list(examineQueryWrapper);
if (CollectionUtils.isNotEmpty(list1)) {
for (Examine examine : list1) {
examineList.add(examine);
}
}
});
}
Long aLong = Long.valueOf(id);
//需要批量生成的map
List<Map<String, Object>> resultList1 = new ArrayList<>();
List<Map<String, Object>> resultList2 = new ArrayList<>();
for (Examine examine : examineList) {
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, examine.getId());
// wrapper.eq(ExamineResult::getStatus, "1");
HashMap<String, Object> map = new HashMap<>(4);
ExamineItem byId = null;
if (examine.getExamineItemId() != null) {
byId = examineItemService.getById(examine.getExamineItemId());
ExamineItem byId = examineItemService.getById(examine.getExamineItemId());
if (byId != null) {
map.put("examineItem", byId.getName());
}
}
ExamineWay byId1 = null;
if (examine.getExamineWayId() != null) {
byId1 = examineWayService.getById(examine.getExamineWayId());
ExamineWay byId1 = examineWayService.getById(examine.getExamineWayId());
if (byId1 != null) {
map.put("examineWay", byId1.getName());
}
}
ExamineBasis byId2 = null;
if (examine.getExamineBasisId() != null) {
byId2 = examineBasisService.getById(examine.getExamineBasisId());
ExamineBasis byId2 = examineBasisService.getById(examine.getExamineBasisId());
if (byId2 != null) {
map.put("examineBasis", byId2.getName());
}
}
ExamineResult one = examineResultService.getOne(wrapper);
// map.put("examineResult", one);
map.put("examineResult", "符合标准");
resultList1.add(map);
if (one != null) {
//实验原始记录json结构
List<Map<String, Object>> list = new ArrayList<>();
String originRecord = one.getOriginRecordResult();
// JSONArray allAppFormMap = JSON.parseArray(originRecord);
// for (Object o : allAppFormMap) {
// Map<String, Object> map0 = (Map<String, Object>) o;
// Map<String, Object> map1 = new HashMap<>();
// Map<String, Object> map2 = new HashMap<>();
// Map<String, Object> map3 = new HashMap<>();
// map1.put("id", map0.get("id1"));
// map2.put("id", map0.get("id2"));
// map3.put("id", map0.get("id3"));
// map1.put("value", map0.get("value1"));
// map2.put("value", map0.get("value2"));
// map3.put("value", map0.get("value3"));
// map1.put("result", map0.get("result1"));
// map2.put("result", map0.get("result2"));
// map3.put("result", map0.get("result3"));
// list.add(map1);
// list.add(map2);
// list.add(map3);
// }
LambdaQueryWrapper<Simple> simpleLambdaQueryWrapper = new LambdaQueryWrapper<>();
simpleLambdaQueryWrapper.eq(Simple::getExperieNum, examine.getExperieNum());
simpleLambdaQueryWrapper.eq(Simple::getEntrustId, examine.getEntrustId());
Simple simple = simpleService.getOne(simpleLambdaQueryWrapper);
String originalNum = "";
if (simple != null) {
originalNum = simple.getOriginalNum();
}
HashMap<String, Object> map2 = new HashMap<>(5);
map2.put("experieNum", examine.getExperieNum());
map2.put("originalNum", originalNum);
map2.put("shuzhi", "检测数值");
map2.put("panding", "结果判定");
map2.put("remark", examine.getRemark());
// for (Map<String, Object> stringObjectMap : list) {
// map2.put("experieNum", examine.getExperieNum());
// map2.put("originalNum", originalNum);
// map2.put("shuzhi", stringObjectMap.get("value"));
// map2.put("panding", stringObjectMap.get("result"));
// map2.put("remark", examine.getRemark());
// }
resultList2.add(map2);
}
}
Map<String, Object> result = new HashMap<>();
result.put("acceptanceNum", entrust.getAcceptanceNum());
result.put("simpleName", entrust.getSimpleName());
result.put("entrustCustomerName", entrust.getEntrustCustomerName());
Map<String, Object> result1 = new HashMap<>();
result1.put("acceptanceNum", entrust.getAcceptanceNum());
result1.put("simpleName", entrust.getSimpleName());
result1.put("takeCompany", entrust.getTakeCompany());
result1.put("takePerson", entrust.getTakePerson());
result1.put("takeCompanyAddress", entrust.getTakeCompanyAddress());
result1.put("takePhone", entrust.getTakePhone());
result1.put("entrustCustomerName", entrust.getEntrustCustomerName());
String value = DictBizCache.getValue(DictBizEnum.ENTRUST_INVESTIGATIVE_TYPE, entrust.getInvestigativeType());
result.put("investigativeType", value);
result.put("mailAddr", entrust.getMailAddr());
result.put("postalCode", entrust.getPostalCode());
result.put("phone", entrust.getPhone());
result.put("facsimile", entrust.getFacsimile());
result.put("reportPreparation", "质量管理室");
result.put("audit", "质量管理室");
result.put("approval", "质量管理室");
result.put("submittedBy", entrust.getSubmittedBy());
result.put("simpleSource", entrust.getSimpleSource());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format1 = "";
result1.put("investigativeType", value);
result1.put("mailAddr", entrust.getMailAddr());
result1.put("phone", entrust.getPhone());
result1.put("submittedBy", entrust.getSubmittedBy());
SimpleDateFormat format3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format4 = "";
if (entrust.getSamplingDate() != null) {
format1 = format.format(entrust.getSamplingDate());
format4 = format3.format(entrust.getSamplingDate());
}
result.put("samplingDate", format1);
result.put("simpleState", entrust.getSimpleState());
result.put("simpleCount", entrust.getSimpleCount());
result.put("code", "仪器");//???
result.put("experieDate", "检测日期");//???
result.put("remark", "备注");//???
result.put("resultList1", resultList1);
result.put("resultList2", resultList2);
result1.put("samplingDate", format4);
result1.put("simpleState", entrust.getSimpleState());
result1.put("simpleCount", entrust.getSimpleCount());
result1.put("code", "仪器");//???
result1.put("experieDate", "检测日期");//???
result1.put("remark", "备注");//???
result1.put("resultList1", resultList1);
// 盖章图片
ImageEntity farView = new ImageEntity();
farView.setHeight(80);//设置高度
@ -465,14 +372,321 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
} catch (Exception e) {
e.printStackTrace();
}
result.put("11", farView);
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告(模板).docx";
result1.put("11", farView);
if (examineList.size() > 0) {
for (Examine examine : examineList) {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> resultList = new ArrayList<>();
LambdaQueryWrapper<ExamineResult> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ExamineResult::getExamineId, examine.getId());
// 检测结果
ExamineResult examineResult = examineResultService.getOne(queryWrapper);
// 检测项目
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
result.put("name", examineItem.getName());
// 布鲁氏检测
if ("2".equals(examineItem.getInputMode())) {
List<ExamineTemplate2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), ExamineTemplate2Excel.class);
if (list != null && list.size() > 0) {
for (ExamineTemplate2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getExperieNum());
map.put("value", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
// PCR检测
else if ("4".equals(examineItem.getInputMode())) {
List<PCR2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), PCR2Excel.class);
if (list != null && list.size() > 0) {
for (PCR2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getExperieNum());
map.put("value", excel.getCtValue());
map.put("result", excel.getValue());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
// XN检测
else if ("5".equals(examineItem.getInputMode())) {
List<XN2Excel> list = JSON.parseArray(examineResult.getExamineDataArr(), XN2Excel.class);
if (list != null && list.size() > 0) {
for (XN2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getExperieNum());
map.put("value", excel.getCtValue());
map.put("result", excel.getValue());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
// 普通和口蹄疫检测
else {
DecimalFormat df = new DecimalFormat("#0.000");
List<ExamineDataArrVO> list = JSON.parseArray(examineResult.getExamineDataArr(), ExamineDataArrVO.class);
List<ExamineDataArrVO> list1 = new ArrayList<>();
// 普通检测原始记录
Collections.sort(list, new Comparator<ExamineDataArrVO>() {
@Override
public int compare(ExamineDataArrVO o1, ExamineDataArrVO o2) {
return o1.getOrder() - o2.getOrder();
}
});
// position1
if ("3".equals(examineItem.getInputMode())) {
// 口蹄疫兰所单板
if ("1".equals(examine.getTemplateType())) {
List<ExamineDataArrVO> voList = JSON.parseArray(examineResult.getOriginRecordResult(), ExamineDataArrVO.class);
Collections.sort(voList, new Comparator<ExamineDataArrVO>() {
@Override
public int compare(ExamineDataArrVO o1, ExamineDataArrVO o2) {
return o1.getOrder() - o2.getOrder();
}
});
List<Double> doubles = new ArrayList<>();
double a1 = Double.parseDouble(list.get(95).getValue());
double a2 = Double.parseDouble(list.get(94).getValue());
double a3 = Double.parseDouble(list.get(93).getValue());
double a4 = Double.parseDouble(list.get(92).getValue());
doubles.add(a1);
doubles.add(a2);
doubles.add(a3);
doubles.add(a4);
List<Double> collect = doubles.stream().sorted().collect(Collectors.toList());
String format2 = df.format((collect.get(1) + collect.get(2)) / 4);
ExamineDataArrVO examineDataArrVO = new ExamineDataArrVO();
examineDataArrVO.setNum("临界值");
examineDataArrVO.setValue(format2);
examineDataArrVO.setResult("");
list1.add(examineDataArrVO);
list1.addAll(voList);
if (list1.size() > 0) {
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getNum());
map.put("value", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
// 口蹄疫兰所多板
else if ("2".equals(examine.getTemplateType())) {
if (list.size() > 0) {
for (int i = 0; i < list.size() / 96; i++) {
List<Double> doubles = new ArrayList<>();
double a1 = Double.parseDouble(list.get((i + 1) * 96 - 1).getValue());
double a2 = Double.parseDouble(list.get((i + 1) * 96 - 2).getValue());
double a3 = Double.parseDouble(list.get((i + 1) * 96 - 3).getValue());
double a4 = Double.parseDouble(list.get((i + 1) * 96 - 4).getValue());
doubles.add(a1);
doubles.add(a2);
doubles.add(a3);
doubles.add(a4);
List<Double> collect = doubles.stream().sorted().collect(Collectors.toList());
String format2 = df.format((collect.get(1) + collect.get(2)) / 4);
ExamineDataArrVO examineDataArrVO = new ExamineDataArrVO();
examineDataArrVO.setNum("临界值");
examineDataArrVO.setValue("");
examineDataArrVO.setResult(format2);
list1.add(examineDataArrVO);
for (int j = 0; j < 96; j++) {
ExamineDataArrVO vo = list.get((i * 96) + j);
if (vo.getNum() != null) {
list1.add(vo);
}
}
}
}
if (list1.size() > 0) {
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getNum());
map.put("value", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
// 口蹄疫非兰所
else {
if (list.size() > 0) {
for (int i = 0; i < list.size() / 96; i++) {
List<Double> doubles = new ArrayList<>();
double a1 = Double.parseDouble(list.get((i + 1) * 96 - 1).getValue());
double a2 = Double.parseDouble(list.get((i + 1) * 96 - 2).getValue());
double a3 = Double.parseDouble(list.get((i + 1) * 96 - 3).getValue());
double a4 = Double.parseDouble(list.get((i + 1) * 96 - 4).getValue());
doubles.add(a1);
doubles.add(a2);
doubles.add(a3);
doubles.add(a4);
List<Double> collect = doubles.stream().sorted().collect(Collectors.toList());
String format2 = df.format((collect.get(1) + collect.get(2)) / 4);
ExamineDataArrVO examineDataArrVO = new ExamineDataArrVO();
examineDataArrVO.setNum("临界值");
examineDataArrVO.setValue("");
examineDataArrVO.setResult(format2);
list1.add(examineDataArrVO);
for (int j = 0; j < 96; j++) {
ExamineDataArrVO vo = list.get((i * 96) + j);
if (vo.getNum() != null) {
list1.add(vo);
}
}
}
}
if (list1.size() > 0) {
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getNum());
map.put("value", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
}
// 普通检测
else {
if (list.size() % 96 == 0) {
for (int i = 0; i < list.size() / 96; i++) {
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));
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));
for (int j = 0; j < 96; j++) {
if (j > 5) {
list1.add(list.get((i * 96) + j));
}
}
}
}
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());
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));
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));
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));
}
}
}
}
if (list1.size() > 0) {
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
map.put("originalNum", simple.getOriginalNum());
map.put("num", excel.getNum());
map.put("value", excel.getValue());
map.put("result", excel.getResult());
resultList.add(map);
}
}
result.put("list", resultList);
}
}
}
}
}
// String handleUrl = "C://Users//AAA//Desktop//烁今//打印模板//检测报告(模板).docx";
XWPFDocument doc = null;
// FileOutputStream fos = null;
FileOutputStream fos = null;
try {
doc = WordExportUtil.exportWord07(print, result);
// fos = new FileOutputStream("C://Users//AAA//Desktop//烁今//打印模板//检测报告.docx");
doc = WordExportUtil.exportWord07(print, result1);
fos = new FileOutputStream("C://Users//AAA//Desktop//shuojin//dayin//1111111.docx");
String filename = "测试.docx";
response.setContentType("application/octet-stream");
@ -485,21 +699,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
} catch (Exception e) {
e.printStackTrace();
} finally {
// if (null != doc) {
//// doc.close();
// try {
// doc.write(fos);
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
// if (null != fos) {
// try {
// fos.close();
// } catch (IOException e) {
// e.printStackTrace();
// }
// }
if (null != doc) {
// doc.close();
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();
@ -518,15 +732,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
String url = "";
// 检测数据
Examine examine = examineService.getById(examineId);
ExamineItem byId = examineItemService.getById(examine.getExamineItemId());
// 检测结果
LambdaQueryWrapper<ExamineResult> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ExamineResult::getExamineId, examine.getId());
ExamineResult examineResult = examineResultService.getOne(wrapper);
// 检测项目
ExamineItem examineItem = examineItemService.getById(examine.getExamineItemId());
ExamineItem byId = examineItemService.getById(examine.getExamineItemId());
// 检测方法
ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
// ExamineWay examineWay = examineWayService.getById(examine.getExamineWayId());
// 检测依据
ExamineBasis examineBasis = examineBasisService.getById(examine.getExamineBasisId());
String[] split = examine.getExperieNum().split(",");
@ -535,39 +748,58 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
result.put("2", examineResult.getDisposal());
result.put("3", examine.getSimpleName());
result.put("4", examine.getSimpleCount());
result.put("5", examineItem.getName());
result.put("5", byId.getName());
if (examineBasis != null) {
result.put("6", examineBasis.getName());
}
// 诊断试剂
String[] split1 = examineResult.getReagentId().split(",");
String regentName = "";
Set set = new HashSet();
for (String s1 : split1) {
Reagent reagent = reagentService.getById(s1);
regentName += reagent.getName() + ",";
Set<String> set = new HashSet();
for (int i = 0; i < split1.length; i++) {
Reagent reagent = reagentService.getById(split1[i]);
if (i == (split1.length - 1)) {
regentName += reagent.getName();
} else {
regentName += reagent.getName() + ",";
}
set.add(reagent.getManufacturer());
}
result.put("7", regentName);
// 生产厂家及批号
String manu = "";
for (Object o : set) {
manu += o + ",";
List<String> strList = new ArrayList<>();
for (String o : set) {
strList.add(o);
}
for (int i = 0; i < strList.size(); i++) {
if (i == (strList.size() - 1)) {
manu += strList.get(i);
} else {
manu += strList.get(i) + ",";
}
}
result.put("8", manu + "(批号:" + examineResult.getBatchNos() + ")");
// 使用仪器名称及编号
String[] split2 = examineResult.getInstrumentId().split(",");
String instrumentName = "";
for (String s1 : split2) {
Instrument instrument = instrumentService.getById(s1);
for (int i = 0; i < split2.length; i++) {
Instrument instrument = instrumentService.getById(split2[i]);
String s2 = instrument.getName() + instrument.getCode();
instrumentName += s2 + ",";
if (i == (split2.length - 1)) {
instrumentName += s2;
} else {
instrumentName += s2 + ",";
}
}
result.put("9", instrumentName);
String value = DictBizCache.getValue(DictBizEnum.SIMPLE_STATUS, examineResult.getSimpleStatus());
result.put("10", value);
result.put("11", "温度" + examineResult.getTemperature() + "℃; " + "湿度" + examineResult.getHumidity() + "%RH");
result.put("12", examineWay.getOperation());
// result.put("12", examineWay.getOperation());
result.put("12", examineResult.getOperateContent());
if (examineBasis != null) {
result.put("13", examineBasis.getContent());
}
@ -2085,6 +2317,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (ExamineTemplate2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2105,6 +2338,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (PCR2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2125,6 +2359,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (XN2Excel excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getExperieNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2183,6 +2418,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2229,6 +2465,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2275,6 +2512,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2347,6 +2585,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for (ExamineDataArrVO excel : list) {
Map<String, Object> map = new HashMap<>();
LambdaQueryWrapper<Simple> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(Simple::getEntrustId, id);
wrapper1.eq(Simple::getExperieNum, excel.getNum());
Simple simple = simpleService.getOne(wrapper1);
if (simple != null) {
@ -2614,6 +2853,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
private void addUseCount(int type, Long elementId) {
System.out.println("type:" + type);
System.out.println("elementId: " + elementId);
if (elementId == null) { return; }
if (type == 1) {
ExamineItem examineItem = examineItemService.getById(elementId);

@ -188,6 +188,19 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
@Override
@Transactional(rollbackFor = Exception.class)
public boolean doExamine(ExamineResult entry) throws Exception {
String batchNos = entry.getBatchNos();
String batchnos = "";
if (batchNos != null && !"".equals(batchNos)) {
String[] split = batchNos.split(",");
for (int i = 0; i < split.length; i++) {
if (i == (split.length - 1)) {
batchnos += split[i];
} else {
batchnos += split[i] + ",";
}
}
entry.setBatchNos(batchnos);
}
electronicSignature();
saves(entry);
Examine currExamine = examineService.getById(entry.getExamineId());
@ -247,6 +260,7 @@ public class ExamineResultServiceImpl extends BaseServiceImpl<ExamineResultMappe
experieNum += simpleDoExamineLog.getExperieNum();
simpleDoExamineLog.setIsFinished(1);
}
// TODO 修改样品状态速度慢
String[] split = experieNum.split(",");
for (String s : split) {
if (split != null && split.length > 0) {

@ -434,6 +434,7 @@ public class UserController {
}
// 硕士及以上人数
wrapper.clear();
wrapper.eq(User::getTenantId, 704067L);
wrapper.eq(User::getEducation, "2");
int count1 = userService.count(wrapper);
// 硕士以下人数

Loading…
Cancel
Save