Compare commits
61 Commits
7a03bc6293
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| dd6df68061 | |||
|
|
468e939ab1 | ||
|
|
90b0aa5202 | ||
|
|
33543e5330 | ||
|
|
6a3d585802 | ||
|
|
9eec0bb05e | ||
|
|
8fd750a82f | ||
|
|
2790ed7ea1 | ||
|
|
9f4369bcb2 | ||
|
|
920292cfac | ||
|
|
1187038ba8 | ||
|
|
e2678fe7b4 | ||
|
|
c1b975cca0 | ||
|
|
b7f30012c8 | ||
|
|
000cfca842 | ||
| 6b006513af | |||
|
|
f2571944c1 | ||
|
|
8e3994b6a8 | ||
|
|
c7f3bc0a46 | ||
| 54bc4b8b37 | |||
|
|
d0ee704939 | ||
|
|
9cf4af15c2 | ||
|
|
ac308f30a2 | ||
|
|
60b2761b2c | ||
|
|
a17621b0dd | ||
| 9ec70c1721 | |||
|
|
3a5f6994a7 | ||
|
|
b355668284 | ||
| 8d75bc0765 | |||
| 0b44562b58 | |||
| 90a1dfbd37 | |||
| 61d91d29b0 | |||
|
|
d84f1adf65 | ||
|
|
4b9d27e8fc | ||
| d41f69cc51 | |||
| 15621a9a56 | |||
|
|
06be110e5d | ||
|
|
ae0f0d79c5 | ||
| 93cf620376 | |||
| be89a965d8 | |||
|
|
8fa69a0906 | ||
|
|
3bb70a94f2 | ||
| 433ac9124b | |||
| 3285e6050a | |||
|
|
c68c7cfbf2 | ||
| 04596350b6 | |||
|
|
927731c217 | ||
| 2b60bd7c7b | |||
|
|
9a2b45e29c | ||
| 7c7e7b4761 | |||
|
|
39d720c1df | ||
|
|
d6fc03b199 | ||
|
|
04ac449897 | ||
|
|
eff36758c2 | ||
|
|
cb50244685 | ||
|
|
246e6391b8 | ||
| 4c129dee4e | |||
| 63fc44a7d1 | |||
| 9a4e50b081 | |||
|
|
7f1c4dd8c4 | ||
|
|
8aa329d989 |
1191
doc/中铜技术文档/iWork集成说明.md
Normal file
1191
doc/中铜技术文档/iWork集成说明.md
Normal file
File diff suppressed because it is too large
Load Diff
12
pom.xml
12
pom.xml
@@ -177,8 +177,8 @@
|
|||||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||||
<config.namespace>dev</config.namespace>
|
<config.namespace>dev</config.namespace>
|
||||||
<config.group>DEFAULT_GROUP</config.group>
|
<config.group>DEFAULT_GROUP</config.group>
|
||||||
<config.username/>
|
<config.username>nacos</config.username>
|
||||||
<config.password/>
|
<config.password>P@ssword25</config.password>
|
||||||
<config.version>1.0.0</config.version>
|
<config.version>1.0.0</config.version>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
@@ -190,8 +190,8 @@
|
|||||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||||
<config.namespace>prod</config.namespace>
|
<config.namespace>prod</config.namespace>
|
||||||
<config.group>DEFAULT_GROUP</config.group>
|
<config.group>DEFAULT_GROUP</config.group>
|
||||||
<config.username/>
|
<config.username>nacos</config.username>
|
||||||
<config.password/>
|
<config.password>P@ssword25</config.password>
|
||||||
<config.version>1.0.0</config.version>
|
<config.version>1.0.0</config.version>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
@@ -203,8 +203,8 @@
|
|||||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||||
<config.namespace>local</config.namespace>
|
<config.namespace>local</config.namespace>
|
||||||
<config.group>DEFAULT_GROUP</config.group>
|
<config.group>DEFAULT_GROUP</config.group>
|
||||||
<config.username/>
|
<config.username>nacos</config.username>
|
||||||
<config.password/>
|
<config.password>P@ssword25</config.password>
|
||||||
<config.version>1.0.0</config.version>
|
<config.version>1.0.0</config.version>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
|||||||
@@ -119,5 +119,9 @@ zt:
|
|||||||
version: ${zt.info.version}
|
version: ${zt.info.version}
|
||||||
tenant: # 多租户相关配置项
|
tenant: # 多租户相关配置项
|
||||||
enable: true
|
enable: true
|
||||||
|
ignore-urls:
|
||||||
|
- /admin-api/qms/system-version-management/get-by-platform/**
|
||||||
|
security:
|
||||||
|
permit-all-urls:
|
||||||
|
- /admin-api/qms/system-version-management/get-by-platform/**
|
||||||
debug: false
|
debug: false
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在");
|
ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在");
|
||||||
ErrorCode CONFIG_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在");
|
ErrorCode CONFIG_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在");
|
||||||
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
|
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
|
||||||
|
ErrorCode CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源与样品类型配置不存在");
|
||||||
|
|
||||||
ErrorCode CONFIG_BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "主样配置不存在");
|
ErrorCode CONFIG_BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "主样配置不存在");
|
||||||
ErrorCode CONFIG_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在");
|
ErrorCode CONFIG_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在");
|
||||||
@@ -87,7 +88,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在");
|
ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在");
|
||||||
ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误");
|
ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误");
|
||||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在");
|
ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在");
|
||||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查库位数据,或联系管理员处理!");
|
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查!");
|
||||||
|
|
||||||
/*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/
|
/*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/
|
||||||
ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在");
|
ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在");
|
||||||
@@ -139,6 +140,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在");
|
ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在");
|
||||||
ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告类型配置不存在");
|
ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告类型配置不存在");
|
||||||
ErrorCode REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告主数据关系不存在");
|
ErrorCode REPORT_DOCUMENT_MAIN_CORRELATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "报告主数据关系不存在");
|
||||||
|
ErrorCode REPORT_DOCUMENT_FILE_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告附件不存在");
|
||||||
|
|
||||||
ErrorCode BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨不存在");
|
ErrorCode BUSINESS_SAMPLE_DISPATCH_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨不存在");
|
||||||
ErrorCode BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨明细不存在");
|
ErrorCode BUSINESS_SAMPLE_DISPATCH_DETAIL_NOT_EXISTS = new ErrorCode(1_032_100_000, "样品调拨明细不存在");
|
||||||
@@ -150,12 +152,38 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||||
|
|
||||||
|
|
||||||
|
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
||||||
|
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
||||||
|
|
||||||
|
ErrorCode MATERIAL_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次不存在");
|
||||||
|
ErrorCode MATERIAL_BATCH_ASSIGN_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料批次分发不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_INBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库,出库不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_INBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "入库明细,出库明细等不存在");
|
||||||
|
|
||||||
|
ErrorCode SYSTEM_VERSION_MANAGEMENT_NOT_EXISTS = new ErrorCode(1_032_150_000, "客户端版本管理不存在");
|
||||||
|
|
||||||
|
ErrorCode MATERIAL_LOCATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "存放位置不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_CHECK_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_CHECK_BATCH_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点项不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_CHECK_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "库存盘点明细不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_OUTBOUND_NOT_EXISTS = new ErrorCode(1_032_150_000, "出库不存在");
|
||||||
|
ErrorCode MATERIAL_INVENTORY_OUTBOUND_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "出库明细,出库明细,含领用出库、退货出库、盘亏出库、销毁出库等不存在");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*================================= office 办公 1_032_250_000 ~ 1_032_299_999 ==================================*/
|
/*================================= office 办公 1_032_250_000 ~ 1_032_299_999 ==================================*/
|
||||||
|
ErrorCode SUPPLIER_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商不存在");
|
||||||
|
ErrorCode SUPPLIER_PROPERTIES_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商属性不存在");
|
||||||
|
ErrorCode SUPPLIER_EVALUATION_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价不存在");
|
||||||
|
ErrorCode SUPPLIER_EVALUATION_AT_NOT_EXISTS = new ErrorCode(1_032_250_000, "供应商评价关系不存在");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*================================= dzj 大质检 1_032_300_000 ~ 1_032_349_999 ==================================*/
|
/*================================= dzj 大质检 1_032_300_000 ~ 1_032_349_999 ==================================*/
|
||||||
|
|||||||
@@ -107,6 +107,15 @@ public interface QmsCommonConstant {
|
|||||||
/** 检验委托 **/
|
/** 检验委托 **/
|
||||||
String ENTRUST_INSPECTION = "entrust_inspection";
|
String ENTRUST_INSPECTION = "entrust_inspection";
|
||||||
|
|
||||||
|
/** 委托样品类型: 委检样 **/
|
||||||
|
String ENTRUST_COMMISSION_INSPECTION_SAMPLE = "commissionInspectionSample";
|
||||||
|
|
||||||
|
/** 委托样品类型: 商检分析样 **/
|
||||||
|
String ENTRUST_INSPECTION_ANALYSIS_SAMPLE = "inspectionAnalysisSample";
|
||||||
|
|
||||||
|
/** 委托样品类型: 商检综合 **/
|
||||||
|
String ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE = "comprehensiveInspectionSample";
|
||||||
|
|
||||||
/** 中心收样 **/
|
/** 中心收样 **/
|
||||||
String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive";
|
String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive";
|
||||||
|
|
||||||
@@ -179,6 +188,10 @@ public interface QmsCommonConstant {
|
|||||||
/** 检验完成状态-未完成 **/
|
/** 检验完成状态-未完成 **/
|
||||||
String UNCHECKED = "unchecked";
|
String UNCHECKED = "unchecked";
|
||||||
|
|
||||||
|
/** 数据回报状态 未回报 **/
|
||||||
|
String UNRETURNED = "unreturned";
|
||||||
|
|
||||||
|
|
||||||
/** 自动 **/
|
/** 自动 **/
|
||||||
String AUTOMATIC = "automatic";
|
String AUTOMATIC = "automatic";
|
||||||
|
|
||||||
@@ -194,4 +207,7 @@ public interface QmsCommonConstant {
|
|||||||
|
|
||||||
/** 允许提交 **/
|
/** 允许提交 **/
|
||||||
String ALLOW_SUBMIT = "allow_submit";
|
String ALLOW_SUBMIT = "allow_submit";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
QMS模块。
|
QMS模块。
|
||||||
</description>
|
</description>
|
||||||
<properties>
|
<properties>
|
||||||
<zzjc.tio.version>3.9.1.v20251013-RELEASE</zzjc.tio.version>
|
<zzjc.tio.version>3.9.1.v20251204-RELEASE</zzjc.tio.version>
|
||||||
|
<liteflow.version>2.15.2</liteflow.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Spring Cloud 基础 -->
|
<!-- Spring Cloud 基础 -->
|
||||||
@@ -141,27 +142,27 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||||
<version>2.15.1</version>
|
<version>${liteflow.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-javax-pro</artifactId>
|
<artifactId>liteflow-script-javax-pro</artifactId>
|
||||||
<version>2.15.1</version>
|
<version>${liteflow.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-groovy</artifactId>
|
<artifactId>liteflow-script-groovy</artifactId>
|
||||||
<version>2.15.1</version>
|
<version>${liteflow.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-qlexpress</artifactId>
|
<artifactId>liteflow-script-qlexpress</artifactId>
|
||||||
<version>2.15.1</version>
|
<version>${liteflow.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-graaljs</artifactId>
|
<artifactId>liteflow-script-graaljs</artifactId>
|
||||||
<version>2.15.1</version>
|
<version>${liteflow.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pdfbox -->
|
<!-- pdfbox -->
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ public class BusinessSampleEntrustRegistrationController implements BusinessCont
|
|||||||
@GetMapping("/queryWaitingDataForReport")
|
@GetMapping("/queryWaitingDataForReport")
|
||||||
@Operation(summary = "查询待编制数据")
|
@Operation(summary = "查询待编制数据")
|
||||||
public CommonResult<PageResult<BusinessSampleEntrustRegistrationExtendRespVO>> queryWaitingDataForReport(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO) {
|
public CommonResult<PageResult<BusinessSampleEntrustRegistrationExtendRespVO>> queryWaitingDataForReport(@Valid BusinessSampleEntrustRegistrationPageReqVO pageReqVO) {
|
||||||
|
Long configReportTypeId = pageReqVO.getConfigReportTypeId();
|
||||||
|
if(configReportTypeId == null)
|
||||||
|
return CommonResult.error(0, "缺少configReportTypeId参数,请刷新后重试!");
|
||||||
PageResult<BusinessSampleEntrustRegistrationExtendRespVO> result = businessSampleEntrustRegistrationService.queryWaitingDataForReport(pageReqVO);
|
PageResult<BusinessSampleEntrustRegistrationExtendRespVO> result = businessSampleEntrustRegistrationService.queryWaitingDataForReport(pageReqVO);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||||
@@ -25,17 +26,11 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/analysis-audit")
|
@RequestMapping("/qms/bus/sample/analysis-audit")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleAnalysisAuditController {
|
public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||||
|
|
||||||
@GetMapping("/crossAuditByTaskId")
|
|
||||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
|
||||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 交叉审核
|
* 交叉审核
|
||||||
* @return
|
* @return
|
||||||
@@ -47,8 +42,8 @@ public class SampleAnalysisAuditController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getSampleResultAssessmentList")
|
@GetMapping("/getSampleResultAssessmentList")
|
||||||
public CommonResult<JSONObject> getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) {
|
public CommonResult<JSONObject> getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId, asmtReportedStatus);
|
JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(reqVO);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService;
|
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService;
|
||||||
@@ -23,7 +24,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/analysis")
|
@RequestMapping("/qms/bus/sample/analysis")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleAnalysisController {
|
public class SampleAnalysisController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleAnalysisService sampleAnalysisService ;
|
private SampleAnalysisService sampleAnalysisService ;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
import com.yomahub.liteflow.core.FlowExecutor;
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
@@ -34,7 +34,7 @@ import jakarta.validation.Valid;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/entrust")
|
@RequestMapping("/qms/bus/sample/entrust")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleEntrustController {
|
public class SampleEntrustController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private FlowExecutor flowExecutor;
|
private FlowExecutor flowExecutor;
|
||||||
@@ -59,14 +59,6 @@ public class SampleEntrustController {
|
|||||||
BusinessSampleEntrustRegistrationExtendRespVO sampleEntrustRegistration = sampleEntrustService.detail(id);
|
BusinessSampleEntrustRegistrationExtendRespVO sampleEntrustRegistration = sampleEntrustService.detail(id);
|
||||||
return success(sampleEntrustRegistration);
|
return success(sampleEntrustRegistration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/reportDetail")
|
|
||||||
@Operation(summary = "委托单详情数据")
|
|
||||||
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
|
||||||
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
|
||||||
return success(jsonObject);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@Operation(summary = "修改委托登记")
|
@Operation(summary = "修改委托登记")
|
||||||
|
|||||||
@@ -1,39 +1,30 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
import com.yomahub.liteflow.core.FlowExecutor;
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
|
||||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext;
|
||||||
import com.zt.plat.module.qms.business.bus.service.SampleFlowService;
|
import com.zt.plat.module.qms.business.bus.service.SampleFlowService;
|
||||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.error;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 样品流转")
|
@Tag(name = "管理后台 - 样品流转")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/flow")
|
@RequestMapping("/qms/bus/sample/flow")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleFlowController {
|
public class SampleFlowController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleFlowService sampleFlowService;
|
private SampleFlowService sampleFlowService;
|
||||||
@@ -45,138 +36,22 @@ public class SampleFlowController {
|
|||||||
public CommonResult<?> sampleFlow(@Validated @RequestBody SampleFlowParam sampleFlowParam) {
|
public CommonResult<?> sampleFlow(@Validated @RequestBody SampleFlowParam sampleFlowParam) {
|
||||||
LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam);
|
LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||||
return success(response.getContextBean(SampleFlowContext.class));
|
return success(response.getContextBean(SampleFlowContext.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/test")
|
|
||||||
public CommonResult<?> test() {
|
|
||||||
|
|
||||||
SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition();
|
|
||||||
sampleFlowDefinition.setFlowKey("flw_sub_sample_process");
|
|
||||||
sampleFlowDefinition.setFlowName("子样样品流转流程");
|
|
||||||
List<SampleFlowNode> flowNodeList = new ArrayList<>();
|
|
||||||
|
|
||||||
SampleFlowNode zxr = new SampleFlowNode();
|
|
||||||
zxr.setNodeName("中心收样");
|
|
||||||
zxr.setNodeKey("flw_center_receive");
|
|
||||||
zxr.setSort(3100);
|
|
||||||
|
|
||||||
SampleFlowNode zxs = new SampleFlowNode();
|
|
||||||
zxs.setNodeName("中心送样");
|
|
||||||
zxs.setNodeKey("flw_center_send");
|
|
||||||
zxs.setSort(3200);
|
|
||||||
|
|
||||||
SampleFlowNode bzr = new SampleFlowNode();
|
|
||||||
bzr.setNodeName("班组收样");
|
|
||||||
bzr.setNodeKey("flw_team_receive");
|
|
||||||
bzr.setSort(3300);
|
|
||||||
|
|
||||||
SampleFlowNode ypbm = new SampleFlowNode();
|
|
||||||
ypbm.setNodeName("样品编密");
|
|
||||||
ypbm.setNodeKey("flw_sample_encrypt");
|
|
||||||
ypbm.setSort(3400);
|
|
||||||
|
|
||||||
// SampleFlowNode fxr = new SampleFlowNode();
|
|
||||||
// fxr.setNodeName("分析收样");
|
|
||||||
// fxr.setNodeKey("flw_analysis_receive");
|
|
||||||
// fxr.setSort(3500);
|
|
||||||
//
|
|
||||||
SampleFlowNode fx = new SampleFlowNode();
|
|
||||||
fx.setNodeName("样品分析");
|
|
||||||
fx.setNodeKey("flw_analysis");
|
|
||||||
fx.setSort(3550);
|
|
||||||
//
|
|
||||||
// SampleFlowNode fxs = new SampleFlowNode();
|
|
||||||
// fxs.setNodeName("分析送样");
|
|
||||||
// fxs.setNodeKey("flw_analysis_send");
|
|
||||||
// fxs.setSort(3600);
|
|
||||||
|
|
||||||
SampleFlowNode bzs = new SampleFlowNode();
|
|
||||||
bzs.setNodeName("班组送样");
|
|
||||||
bzs.setNodeKey("flw_team_send");
|
|
||||||
bzs.setSort(3700);
|
|
||||||
|
|
||||||
SampleFlowNode ypgk = new SampleFlowNode();
|
|
||||||
ypgk.setNodeName("样品归库");
|
|
||||||
ypgk.setNodeKey("flw_sample_storage");
|
|
||||||
ypgk.setSort(3800);
|
|
||||||
ypgk.setNextFlowNodeList(null);
|
|
||||||
flowNodeList.add(ypgk);
|
|
||||||
|
|
||||||
|
|
||||||
zxr.setNextFlowNodeList(new ArrayList<SampleFlowNode>() {
|
|
||||||
{
|
|
||||||
add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
flowNodeList.add(zxr);
|
|
||||||
|
|
||||||
|
|
||||||
zxs.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true));
|
|
||||||
}});
|
|
||||||
flowNodeList.add(zxs);
|
|
||||||
|
|
||||||
bzr.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
|
||||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过
|
|
||||||
}});
|
|
||||||
flowNodeList.add(bzr);
|
|
||||||
|
|
||||||
|
|
||||||
ypbm.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true));
|
|
||||||
}});
|
|
||||||
flowNodeList.add(ypbm);
|
|
||||||
|
|
||||||
|
|
||||||
// fxr.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true));
|
|
||||||
// }});
|
|
||||||
// flowNodeList.add(fxr);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// fxs.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
|
||||||
// }});
|
|
||||||
// flowNodeList.add(fxs);
|
|
||||||
|
|
||||||
fx.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
|
||||||
}});
|
|
||||||
flowNodeList.add(fx);
|
|
||||||
|
|
||||||
bzs.setNextFlowNodeList(new ArrayList<>() {{
|
|
||||||
// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检"));
|
|
||||||
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报
|
|
||||||
add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完
|
|
||||||
}});
|
|
||||||
flowNodeList.add(bzs);
|
|
||||||
|
|
||||||
sampleFlowDefinition.setFlowNodeList(flowNodeList);
|
|
||||||
|
|
||||||
String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition);
|
|
||||||
|
|
||||||
System.out.println(jsonSampleFlowDefinition);
|
|
||||||
|
|
||||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
|
||||||
|
|
||||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
|
||||||
sampleFlowInfoList.add(new SampleFlowInfo().setId(1967550576457330690L).setIsWeighing(0));
|
|
||||||
|
|
||||||
SampleFlowParam sampleFlowParam = new SampleFlowParam();
|
|
||||||
sampleFlowParam.setSampleSourceType(2);
|
|
||||||
sampleFlowParam.setCurrentSampleFlowKey("P3000");
|
|
||||||
sampleFlowParam.setSampleFlowInfoList(sampleFlowInfoList);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class);
|
|
||||||
if (response.isSuccess()) {
|
|
||||||
return success(response.getContextBean(SampleFlowContext.class));
|
|
||||||
} else {
|
|
||||||
return error(1_032_100_000, response.getMessage());
|
|
||||||
}
|
|
||||||
//return success(FlowBus.getNodeMap());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中心收样并送样
|
||||||
|
* @param sampleFlowParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/centerReceiveAndSend")
|
||||||
|
public CommonResult<?> centerReceiveAndSend(@Validated @RequestBody SampleFlowParam sampleFlowParam) {
|
||||||
|
//中心收样
|
||||||
|
sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_RECEIVE);
|
||||||
|
LiteflowResponse response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||||
|
//中心送样
|
||||||
|
sampleFlowParam.setCurrentSampleFlowKey(QmsCommonConstant.FLOW_NODE_CENTER_SEND);
|
||||||
|
sampleFlowParam.setSendSampleOper(null);
|
||||||
|
response = sampleFlowService.sampleFlow(sampleFlowParam);
|
||||||
|
return success(response.getContextBean(SampleFlowContext.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||||
|
import com.zt.plat.module.qms.business.bus.service.SampleEntrustService;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报表数据查询接口,不继承BusinessControllerMarker
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/bus/sample/reporting-data-query")
|
||||||
|
public class SampleReportDataQueryController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SampleEntrustService sampleEntrustService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||||
|
|
||||||
|
@GetMapping("/entrust-report-detail")
|
||||||
|
@Operation(summary = "委托单详情数据")
|
||||||
|
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
||||||
|
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
||||||
|
return success(jsonObject);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "委托单详情数据")
|
||||||
|
@GetMapping("/crossAuditByTaskId")
|
||||||
|
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||||
|
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService;
|
import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService;
|
||||||
@@ -28,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/result-reporting")
|
@RequestMapping("/qms/bus/sample/result-reporting")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleResultReportingController {
|
public class SampleResultReportingController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleResultReportingService sampleResultReportingService;
|
private SampleResultReportingService sampleResultReportingService;
|
||||||
@@ -42,8 +43,8 @@ public class SampleResultReportingController {
|
|||||||
|
|
||||||
//获取方法对应的样品
|
//获取方法对应的样品
|
||||||
@GetMapping("/getSampleResultReportingList")
|
@GetMapping("/getSampleResultReportingList")
|
||||||
public CommonResult<?> getSampleResultReportingList(Long configAssayMethodId) {
|
public CommonResult<?> getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) {
|
||||||
JSONObject result = sampleResultReportingService.getSampleResultReportingList(configAssayMethodId);
|
JSONObject result = sampleResultReportingService.getSampleResultReportingList(reqVO);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
@@ -27,7 +28,7 @@ import jakarta.annotation.Resource;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/bus/sample/task-assign")
|
@RequestMapping("/qms/bus/sample/task-assign")
|
||||||
@Validated
|
@Validated
|
||||||
public class SampleTaskAssignController {
|
public class SampleTaskAssignController implements BusinessControllerMarker {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleTaskAssignService sampleTaskAssignService;
|
private SampleTaskAssignService sampleTaskAssignService;
|
||||||
@@ -38,6 +39,13 @@ public class SampleTaskAssignController {
|
|||||||
List<AdminUserRespDTO> list = sampleTaskAssignService.getAssignUserList();
|
List<AdminUserRespDTO> list = sampleTaskAssignService.getAssignUserList();
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(description = "根据用户id获取用户信息")
|
||||||
|
@GetMapping("/getUserInfoById")
|
||||||
|
public CommonResult<?> getUserInfoById(Long userId) {
|
||||||
|
AdminUserRespDTO userRespDTO = sampleTaskAssignService.getUserInfoById(userId);
|
||||||
|
return success(userRespDTO);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/getAssaySampleList")
|
@GetMapping("/getAssaySampleList")
|
||||||
public CommonResult<?> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
public CommonResult<?> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
|
|||||||
@@ -0,0 +1,155 @@
|
|||||||
|
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition;
|
||||||
|
import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/bus/test")
|
||||||
|
public class TestController {
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/testSampleFlow")
|
||||||
|
public CommonResult<?> testSampleFlow() {
|
||||||
|
|
||||||
|
SampleFlowDefinition sampleFlowDefinition = new SampleFlowDefinition();
|
||||||
|
sampleFlowDefinition.setFlowKey("flw_sub_sample_process");
|
||||||
|
sampleFlowDefinition.setFlowName("子样样品流转流程");
|
||||||
|
List<SampleFlowNode> flowNodeList = new ArrayList<>();
|
||||||
|
|
||||||
|
SampleFlowNode zxr = new SampleFlowNode();
|
||||||
|
zxr.setNodeName("中心收样");
|
||||||
|
zxr.setNodeKey("flw_center_receive");
|
||||||
|
zxr.setSort(3100);
|
||||||
|
|
||||||
|
SampleFlowNode zxs = new SampleFlowNode();
|
||||||
|
zxs.setNodeName("中心送样");
|
||||||
|
zxs.setNodeKey("flw_center_send");
|
||||||
|
zxs.setSort(3200);
|
||||||
|
|
||||||
|
SampleFlowNode bzr = new SampleFlowNode();
|
||||||
|
bzr.setNodeName("班组收样");
|
||||||
|
bzr.setNodeKey("flw_team_receive");
|
||||||
|
bzr.setSort(3300);
|
||||||
|
|
||||||
|
SampleFlowNode ypbm = new SampleFlowNode();
|
||||||
|
ypbm.setNodeName("样品编密");
|
||||||
|
ypbm.setNodeKey("flw_sample_encrypt");
|
||||||
|
ypbm.setSort(3400);
|
||||||
|
|
||||||
|
// SampleFlowNode fxr = new SampleFlowNode();
|
||||||
|
// fxr.setNodeName("分析收样");
|
||||||
|
// fxr.setNodeKey("flw_analysis_receive");
|
||||||
|
// fxr.setSort(3500);
|
||||||
|
//
|
||||||
|
SampleFlowNode fx = new SampleFlowNode();
|
||||||
|
fx.setNodeName("样品分析");
|
||||||
|
fx.setNodeKey("flw_analysis");
|
||||||
|
fx.setSort(3550);
|
||||||
|
//
|
||||||
|
// SampleFlowNode fxs = new SampleFlowNode();
|
||||||
|
// fxs.setNodeName("分析送样");
|
||||||
|
// fxs.setNodeKey("flw_analysis_send");
|
||||||
|
// fxs.setSort(3600);
|
||||||
|
|
||||||
|
SampleFlowNode bzs = new SampleFlowNode();
|
||||||
|
bzs.setNodeName("班组送样");
|
||||||
|
bzs.setNodeKey("flw_team_send");
|
||||||
|
bzs.setSort(3700);
|
||||||
|
|
||||||
|
SampleFlowNode ypgk = new SampleFlowNode();
|
||||||
|
ypgk.setNodeName("样品归库");
|
||||||
|
ypgk.setNodeKey("flw_sample_storage");
|
||||||
|
ypgk.setSort(3800);
|
||||||
|
ypgk.setNextFlowNodeList(null);
|
||||||
|
flowNodeList.add(ypgk);
|
||||||
|
|
||||||
|
|
||||||
|
zxr.setNextFlowNodeList(new ArrayList<SampleFlowNode>() {
|
||||||
|
private static final long serialVersionUID = 6146393613606839512L;
|
||||||
|
|
||||||
|
{
|
||||||
|
add(BeanUtils.toBean(zxs,SampleFlowNode.class).setIsDefault(true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
flowNodeList.add(zxr);
|
||||||
|
|
||||||
|
|
||||||
|
zxs.setNextFlowNodeList(new ArrayList<>() {
|
||||||
|
private static final long serialVersionUID = 5357543125760924047L;
|
||||||
|
|
||||||
|
{
|
||||||
|
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setIsDefault(true));
|
||||||
|
}});
|
||||||
|
flowNodeList.add(zxs);
|
||||||
|
|
||||||
|
bzr.setNextFlowNodeList(new ArrayList<>() {
|
||||||
|
private static final long serialVersionUID = 6376704859477839016L;
|
||||||
|
|
||||||
|
{
|
||||||
|
add(BeanUtils.toBean(ypbm,SampleFlowNode.class).setCondition("subSampleEncrypt"));//样品需要编密并且没编密过
|
||||||
|
add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("subSampleNotEncrypt"));//样品无需编密或样品已编密过
|
||||||
|
}});
|
||||||
|
flowNodeList.add(bzr);
|
||||||
|
|
||||||
|
|
||||||
|
ypbm.setNextFlowNodeList(new ArrayList<>() {
|
||||||
|
private static final long serialVersionUID = 1014984817516902869L;
|
||||||
|
|
||||||
|
{
|
||||||
|
add(BeanUtils.toBean(fx,SampleFlowNode.class).setIsDefault(true));
|
||||||
|
}});
|
||||||
|
flowNodeList.add(ypbm);
|
||||||
|
|
||||||
|
|
||||||
|
// fxr.setNextFlowNodeList(new ArrayList<>() {{
|
||||||
|
// add(BeanUtils.toBean(fxs,SampleFlowNode.class).setIsDefault(true));
|
||||||
|
// }});
|
||||||
|
// flowNodeList.add(fxr);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// fxs.setNextFlowNodeList(new ArrayList<>() {{
|
||||||
|
// add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||||
|
// }});
|
||||||
|
// flowNodeList.add(fxs);
|
||||||
|
|
||||||
|
fx.setNextFlowNodeList(new ArrayList<>() {
|
||||||
|
private static final long serialVersionUID = -610440034210287957L;
|
||||||
|
|
||||||
|
{
|
||||||
|
add(BeanUtils.toBean(bzs,SampleFlowNode.class).setIsDefault(true).setCondition("当前部门任务已全部分析完"));
|
||||||
|
}});
|
||||||
|
flowNodeList.add(fx);
|
||||||
|
|
||||||
|
bzs.setNextFlowNodeList(new ArrayList<>() {
|
||||||
|
private static final long serialVersionUID = -5057434004685743838L;
|
||||||
|
|
||||||
|
{
|
||||||
|
// add(BeanUtils.toBean(fx,SampleFlowNode.class).setCondition("样品当前分析班组结果超差,需要发起复检"));
|
||||||
|
add(BeanUtils.toBean(bzr,SampleFlowNode.class).setCondition("subSampleSelfReportedOthersPending"));//当前部门数据已全部判断上报
|
||||||
|
add(BeanUtils.toBean(ypgk,SampleFlowNode.class).setCondition("subSampleAlldeptAnalyzed"));//当前样品所有分析任务已全部上报完
|
||||||
|
}});
|
||||||
|
flowNodeList.add(bzs);
|
||||||
|
|
||||||
|
sampleFlowDefinition.setFlowNodeList(flowNodeList);
|
||||||
|
|
||||||
|
String jsonSampleFlowDefinition = JSON.toJSONString(sampleFlowDefinition);
|
||||||
|
|
||||||
|
System.out.println(jsonSampleFlowDefinition);
|
||||||
|
|
||||||
|
return success(jsonSampleFlowDefinition);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,6 +18,9 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp
|
|||||||
@Schema(description = "分析方法名称")
|
@Schema(description = "分析方法名称")
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "子样配置id")
|
@Schema(description = "子样配置id")
|
||||||
private Long configSubSampleId;
|
private Long configSubSampleId;
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,14 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BusinessAssayTaskDataGroupRespVO {
|
public class BusinessAssayTaskDataGroupRespVO {
|
||||||
|
|
||||||
|
/** 方法id **/
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
/** 方法名称 **/
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
/** 方法名称及类别 **/
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
private String assayType;
|
private String assayType;
|
||||||
|
|
||||||
|
|||||||
@@ -98,4 +98,8 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
//===================================扩展字段===============================================
|
||||||
|
|
||||||
|
@Schema(description = "样品状态")
|
||||||
|
private String sampleStatus;
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,26 @@ public class BusinessAssayTaskDataReqVO {
|
|||||||
//=== 扩展字段,判定上报状态
|
//=== 扩展字段,判定上报状态
|
||||||
@Schema(description = "判定上报状态")
|
@Schema(description = "判定上报状态")
|
||||||
private String asmtReportedStatus;
|
private String asmtReportedStatus;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "样品状态")
|
||||||
|
private String sampleStatus;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称")
|
||||||
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
|
@Schema(description = "收样时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] sampleReceiveTime;
|
||||||
|
|
||||||
|
@Schema(description = "样品编号")
|
||||||
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "分析编号")
|
||||||
|
private String sampleAssayCode;
|
||||||
|
|
||||||
|
@Schema(description = "归库编号")
|
||||||
|
private String sampleReturnCode;
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,6 +25,9 @@ public class BusinessAssayTaskExtendRespVO extends BusinessAssayTaskRespVO {
|
|||||||
/** 分析方法名称 **/
|
/** 分析方法名称 **/
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
/** 分析方法对应的分析项目 **/
|
/** 分析方法对应的分析项目 **/
|
||||||
private String configAssayMethodProjectShowNames;
|
private String configAssayMethodProjectShowNames;
|
||||||
|
|
||||||
|
|||||||
@@ -100,10 +100,10 @@ public class BusinessAssayTaskPageReqVO extends PageParam {
|
|||||||
@Schema(description = "签名信息")
|
@Schema(description = "签名信息")
|
||||||
private String documentSignature;
|
private String documentSignature;
|
||||||
|
|
||||||
@Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2")
|
@Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2")
|
||||||
private String finishStatus;
|
private String finishStatus;
|
||||||
|
|
||||||
@Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1")
|
@Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
|
|||||||
@@ -99,10 +99,10 @@ public class BusinessAssayTaskReqVO {
|
|||||||
@Schema(description = "签名信息")
|
@Schema(description = "签名信息")
|
||||||
private String documentSignature;
|
private String documentSignature;
|
||||||
|
|
||||||
@Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2")
|
@Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2")
|
||||||
private String finishStatus;
|
private String finishStatus;
|
||||||
|
|
||||||
@Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1")
|
@Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import com.alibaba.excel.annotation.*;
|
import com.alibaba.excel.annotation.*;
|
||||||
|
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 检测任务分配业务 Response VO")
|
@Schema(description = "管理后台 - 检测任务分配业务 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -116,12 +117,13 @@ public class BusinessAssayTaskRespVO {
|
|||||||
@ExcelProperty("签名信息")
|
@ExcelProperty("签名信息")
|
||||||
private String documentSignature;
|
private String documentSignature;
|
||||||
|
|
||||||
@Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2")
|
@Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2")
|
||||||
@ExcelProperty("完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved")
|
@ExcelProperty("完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed")
|
||||||
private String finishStatus;
|
private String finishStatus;
|
||||||
|
|
||||||
@Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1")
|
@Dict(dicCode = "flow_status")
|
||||||
@ExcelProperty("流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved")
|
@Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1")
|
||||||
|
@ExcelProperty("流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
|
|||||||
@@ -102,10 +102,10 @@ public class BusinessAssayTaskSaveReqVO {
|
|||||||
@Schema(description = "签名信息")
|
@Schema(description = "签名信息")
|
||||||
private String documentSignature;
|
private String documentSignature;
|
||||||
|
|
||||||
@Schema(description = "完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "2")
|
@Schema(description = "完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "2")
|
||||||
private String finishStatus;
|
private String finishStatus;
|
||||||
|
|
||||||
@Schema(description = "流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved", example = "1")
|
@Schema(description = "流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed", example = "1")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
@Schema(description = "所属部门")
|
||||||
|
|||||||
@@ -64,5 +64,16 @@ public class BusinessHandoverRecordSubPageReqVO extends PageParam {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
//==============扩展字段================
|
||||||
|
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "分析编号")
|
||||||
|
private String sampleAssayCode;
|
||||||
|
|
||||||
|
@Schema(description = "归库编号")
|
||||||
|
private String sampleReturnCode;
|
||||||
|
|
||||||
|
@Schema(description = "样品名称")
|
||||||
|
private String sampleName;
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,11 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BusinessSampleEntrustDetailExtendRespVO extends BusinessSampleEntrustDetailRespVO {
|
public class BusinessSampleEntrustDetailExtendRespVO extends BusinessSampleEntrustDetailRespVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 样品类型key
|
||||||
|
*/
|
||||||
|
private String sampleTypeDictionaryBusinessKey;
|
||||||
|
|
||||||
/** 样品大类名称 **/
|
/** 样品大类名称 **/
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|
||||||
|
|||||||
@@ -156,4 +156,7 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam {
|
|||||||
//====================扩展字段======================
|
//====================扩展字段======================
|
||||||
@Schema(description = "委托来源名称")
|
@Schema(description = "委托来源名称")
|
||||||
private String configEntrustSourceName;
|
private String configEntrustSourceName;
|
||||||
|
|
||||||
|
@Schema(description = "报表配置id")
|
||||||
|
private Long configReportTypeId;
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import java.util.*;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import com.alibaba.excel.annotation.*;
|
import com.alibaba.excel.annotation.*;
|
||||||
|
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 委检登记业务 Response VO")
|
@Schema(description = "管理后台 - 委检登记业务 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@@ -144,10 +145,12 @@ public class BusinessSampleEntrustRegistrationRespVO {
|
|||||||
@ExcelProperty("数据校验状态,success-数据校验成功、fail-数据校验失败")
|
@ExcelProperty("数据校验状态,success-数据校验成功、fail-数据校验失败")
|
||||||
private String dataCheckStatus;
|
private String dataCheckStatus;
|
||||||
|
|
||||||
|
@Dict(dicCode = "entrust_assay_status")
|
||||||
@Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2")
|
@Schema(description = "检验状态,unchecked-未检验;checked-已检验", example = "2")
|
||||||
@ExcelProperty("检验状态,unchecked-未检验;checked-已检验")
|
@ExcelProperty("检验状态,unchecked-未检验;checked-已检验")
|
||||||
private String assayStatus;
|
private String assayStatus;
|
||||||
|
|
||||||
|
@Dict(dicCode = "entrust_data_status")
|
||||||
@Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1")
|
@Schema(description = "数据回报状态,unreturned-未回报;returned-已回报", example = "1")
|
||||||
@ExcelProperty("数据回报状态,unreturned-未回报;returned-已回报")
|
@ExcelProperty("数据回报状态,unreturned-未回报;returned-已回报")
|
||||||
private String dataStatus;
|
private String dataStatus;
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -11,10 +17,17 @@ public class BusinessSubParentSampleAssessmentGroupReqVO {
|
|||||||
|
|
||||||
@Schema(description = "分析方法名称")
|
@Schema(description = "分析方法名称")
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "分析部门ID")
|
@Schema(description = "分析部门ID")
|
||||||
private Long assayDepartmentId;
|
private Long assayDepartmentId;
|
||||||
|
|
||||||
@Schema(description = "分析部门名称")
|
@Schema(description = "分析部门名称")
|
||||||
private String assayDepartmentName;
|
private String assayDepartmentName;
|
||||||
|
|
||||||
|
@Schema(description = "收样时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] sampleReceiveTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ public class BusinessSubParentSampleAssessmentGroupRespVO {
|
|||||||
|
|
||||||
@Schema(description = "分析方法名称")
|
@Schema(description = "分析方法名称")
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "分析部门ID")
|
@Schema(description = "分析部门ID")
|
||||||
private Long assayDepartmentId;
|
private Long assayDepartmentId;
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class BusinessSubSampleAnalysisGroupPageReqVO extends PageParam {
|
|||||||
@Schema(description = "样品状态", example = "1")
|
@Schema(description = "样品状态", example = "1")
|
||||||
private String sampleStatus;
|
private String sampleStatus;
|
||||||
|
|
||||||
|
@Schema(description = "是否送样")
|
||||||
|
private Integer isSend;
|
||||||
|
|
||||||
@Schema(description = "收样人")
|
@Schema(description = "收样人")
|
||||||
private String sampleReceiver;
|
private String sampleReceiver;
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ public class BusinessSubSampleAnalysisGroupRespVO {
|
|||||||
@ExcelProperty("样品状态")
|
@ExcelProperty("样品状态")
|
||||||
private String sampleStatus;
|
private String sampleStatus;
|
||||||
|
|
||||||
|
@Schema(description = "是否送样")
|
||||||
|
private Integer isSend;
|
||||||
|
|
||||||
@Schema(description = "收样人")
|
@Schema(description = "收样人")
|
||||||
@ExcelProperty("收样人")
|
@ExcelProperty("收样人")
|
||||||
private String sampleReceiver;
|
private String sampleReceiver;
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public class BusinessSubSampleAnalysisGroupSaveReqVO {
|
|||||||
@NotEmpty(message = "样品状态不能为空")
|
@NotEmpty(message = "样品状态不能为空")
|
||||||
private String sampleStatus;
|
private String sampleStatus;
|
||||||
|
|
||||||
|
@Schema(description = "是否送样")
|
||||||
|
private Integer isSend;
|
||||||
|
|
||||||
@Schema(description = "收样人")
|
@Schema(description = "收样人")
|
||||||
private String sampleReceiver;
|
private String sampleReceiver;
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO {
|
|||||||
|
|
||||||
@Schema(description = "分析部门名称")
|
@Schema(description = "分析部门名称")
|
||||||
private String assayDepartmentName;
|
private String assayDepartmentName;
|
||||||
|
|
||||||
|
@Schema(description = "是否已送样")
|
||||||
|
private Integer isSendSample;
|
||||||
|
|
||||||
@Schema(description = "是否打印")
|
@Schema(description = "是否打印")
|
||||||
private Integer isPrint;
|
private Integer isPrint;
|
||||||
|
|||||||
@@ -145,6 +145,9 @@ public class BusinessSubSamplePageReqVO extends PageParam {
|
|||||||
@Schema(description = "分析部门状态")
|
@Schema(description = "分析部门状态")
|
||||||
private String assayDepartmentStatus;
|
private String assayDepartmentStatus;
|
||||||
|
|
||||||
|
@Schema(description = "是否已送样")
|
||||||
|
private Integer isSendSample;
|
||||||
|
|
||||||
@Schema(description = "样品流程节点KEY列表")
|
@Schema(description = "样品流程节点KEY列表")
|
||||||
private List<String> sampleFlowNodeKeyList;
|
private List<String> sampleFlowNodeKeyList;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -22,4 +24,7 @@ public class NoReportSubParentSampleAssessmentRespVO {
|
|||||||
private String taskType;
|
private String taskType;
|
||||||
|
|
||||||
private String assayType;
|
private String assayType;
|
||||||
|
|
||||||
|
|
||||||
|
private LocalDateTime sampleReceiveTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@@ -20,6 +21,9 @@ public class RecheckSubSampleParentMethodRespVO {
|
|||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
private Long baseSampleId;
|
private Long baseSampleId;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.dal.dataobject;
|
package com.zt.plat.module.qms.business.bus.dal.dataobject;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -109,4 +110,20 @@ public class BusinessAssayReportDataDO extends BusinessBaseDO {
|
|||||||
//样品创建时间
|
//样品创建时间
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private LocalDateTime baseSampleCreateTime;
|
private LocalDateTime baseSampleCreateTime;
|
||||||
|
|
||||||
|
//样品类型key
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sampleTypeKey;
|
||||||
|
|
||||||
|
//委托样品名称
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String entrustSampleName;
|
||||||
|
|
||||||
|
//委托样品编号
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String entrustSampleCode;
|
||||||
|
|
||||||
|
//委托明细排序
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer entrustDetailSort;
|
||||||
}
|
}
|
||||||
@@ -160,12 +160,12 @@ public class BusinessAssayTaskDO extends BusinessBaseDO {
|
|||||||
@TableField("DOC_SIG")
|
@TableField("DOC_SIG")
|
||||||
private String documentSignature;
|
private String documentSignature;
|
||||||
/**
|
/**
|
||||||
* 完成状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved
|
* 完成状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed
|
||||||
*/
|
*/
|
||||||
@TableField("FIN_STS")
|
@TableField("FIN_STS")
|
||||||
private String finishStatus;
|
private String finishStatus;
|
||||||
/**
|
/**
|
||||||
* 流程状态,未开始-not_start、审核中-running、已退回-returned、已通过-approved
|
* 流程状态,未开始-not_start、审核中-in_progress、已退回-returned、已通过-completed
|
||||||
*/
|
*/
|
||||||
@TableField("FLW_STS")
|
@TableField("FLW_STS")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ public class BusinessSubSampleAnalysisGroupDO extends BusinessBaseDO {
|
|||||||
@TableField("SMP_STS")
|
@TableField("SMP_STS")
|
||||||
private String sampleStatus;
|
private String sampleStatus;
|
||||||
/**
|
/**
|
||||||
|
* 是否送样
|
||||||
|
*/
|
||||||
|
@TableField("IS_SND")
|
||||||
|
private Integer isSend;
|
||||||
|
/**
|
||||||
* 收样人
|
* 收样人
|
||||||
*/
|
*/
|
||||||
@TableField("SMP_RCVR")
|
@TableField("SMP_RCVR")
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterD
|
|||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
|
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -27,21 +29,20 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
|||||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessAssayParameterDataReqVO reqVO) {
|
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessAssayParameterDataReqVO reqVO) {
|
||||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId)
|
|
||||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||||
.selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
.selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||||
.selectAs(BusinessAssayParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
.selectAs(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||||
.selectAs(BusinessAssayParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
.selectAs(BusinessAssayParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||||
.selectAs(BusinessAssayParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
.selectAs(BusinessAssayParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||||
.selectAs(BusinessAssayParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
.selectAs(BusinessAssayParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||||
@@ -86,11 +87,22 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
|||||||
|
|
||||||
default List<BusinessAssayParameterDataExtendRespVO> selectExtendByBusinessAssayProjectDataIds(List<Long> businessAssayProjectDataIds) {
|
default List<BusinessAssayParameterDataExtendRespVO> selectExtendByBusinessAssayProjectDataIds(List<Long> businessAssayProjectDataIds) {
|
||||||
return selectJoinList(BusinessAssayParameterDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
return selectJoinList(BusinessAssayParameterDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId)
|
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||||
.selectAll(BusinessAssayParameterDataDO.class)
|
.selectAll(BusinessAssayParameterDataDO.class)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayParameterDataExtendRespVO::getParameterName)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayParameterDataExtendRespVO::getParameterName)
|
||||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey)
|
||||||
.in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds));
|
.in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default BusinessAssayParameterDataDO selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(Long businessAssayTaskDataId, String projectSimpleName, String parameterKey) {
|
||||||
|
return selectJoinOne(BusinessAssayParameterDataDO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||||
|
.leftJoin(BusinessAssayProjectDataDO.class, BusinessAssayProjectDataDO::getId, BusinessAssayParameterDataDO::getBusinessAssayProjectDataId)
|
||||||
|
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId)
|
||||||
|
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||||
|
.eq(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataId)
|
||||||
|
.eq(DictionaryProjectDO::getSimpleName, projectSimpleName)
|
||||||
|
.eq(ConfigAssayMethodProjectParameterDO::getKey, parameterKey));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
|||||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||||
.selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
.selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||||
.selectAs(BusinessAssayProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
.selectAs(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.zt.plat.module.qms.business.bus.dal.mapper;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl.On;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
@@ -16,7 +15,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataRe
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentProjectDO;
|
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
@@ -26,7 +24,6 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
|
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -39,83 +36,209 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTaskDataDO> {
|
public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTaskDataDO> {
|
||||||
|
|
||||||
default List<BusinessAssayTaskDataExtendRespVO> selectList(BusinessAssayTaskDataReqVO reqVO) {
|
default List<BusinessAssayTaskDataExtendRespVO> selectList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
.selectAll(BusinessAssayTaskDataDO.class)
|
.leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
||||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
.selectAll(BusinessAssayTaskDataDO.class)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId);
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
}
|
||||||
.likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
}
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime())
|
if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId());
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId());
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount())
|
if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
}
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime())
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType());
|
||||||
.orderByDesc(BusinessAssayTaskDataDO::getId));
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) {
|
||||||
|
mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReporter())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAnalysisCount())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getRemark())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus());
|
||||||
|
}
|
||||||
|
mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getSampleFlowNodeTime);
|
||||||
|
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
default PageResult<BusinessAssayTaskDataExtendRespVO> selectPage(BusinessAssayTaskDataPageReqVO reqVO) {
|
default PageResult<BusinessAssayTaskDataExtendRespVO> selectPage(BusinessAssayTaskDataPageReqVO reqVO) {
|
||||||
return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
.selectAll(BusinessAssayTaskDataDO.class)
|
.leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
||||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
.selectAll(BusinessAssayTaskDataDO.class)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId);
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
}
|
||||||
.likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
}
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime())
|
if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId());
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId())
|
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId());
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime())
|
}
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount())
|
if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType());
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
}
|
||||||
.betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime())
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) {
|
||||||
.eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark())
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType());
|
||||||
.orderByDesc(BusinessAssayTaskDataDO::getId));
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) {
|
||||||
|
mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReporter())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getAnalysisCount())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) {
|
||||||
|
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getRemark())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) {
|
||||||
|
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus());
|
||||||
|
}
|
||||||
|
mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getSampleFlowNodeTime);
|
||||||
|
return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -140,6 +263,31 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessAssayTaskDataExtendRespVO> selectBySampleAssayCodesAndConfigAssayMethodId(List<String> sampleAssayCodes, Long configAssayMethodId) {
|
||||||
|
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
|
.selectAll(BusinessAssayTaskDataDO.class)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
|
.in(BusinessSubSampleDO::getSampleAssayCode, sampleAssayCodes)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BusinessAssayTaskDataExtendRespVO> selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List<String> sampleAssayCodes, String configAssayMethodDictionaryBusinessKey) {
|
||||||
|
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||||
|
.selectAll(BusinessAssayTaskDataDO.class)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
|
.in(BusinessSubSampleDO::getSampleAssayCode, sampleAssayCodes)
|
||||||
|
.eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
||||||
|
}
|
||||||
|
|
||||||
default List<BusinessAssayTaskDataExtendRespVO> selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) {
|
default List<BusinessAssayTaskDataExtendRespVO> selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapper<BusinessAssayTaskDataDO>()
|
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapper<BusinessAssayTaskDataDO>()
|
||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||||
@@ -150,6 +298,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
||||||
.selectAll(BusinessAssayTaskDataDO.class)
|
.selectAll(BusinessAssayTaskDataDO.class)
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.selectAs(ConfigAssayMethodDO::getConfigReportTemplateKey, BusinessAssayTaskDataExtendRespVO::getConfigReportTemplateKey)
|
.selectAs(ConfigAssayMethodDO::getConfigReportTemplateKey, BusinessAssayTaskDataExtendRespVO::getConfigReportTemplateKey)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
@@ -178,6 +327,9 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getSampleReceiveTime()) && reqVO.getSampleReceiveTime().length == 2) {
|
||||||
|
mpjLambdaWrapper.between(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, reqVO.getSampleReceiveTime()[0], reqVO.getSampleReceiveTime()[1]);
|
||||||
|
}
|
||||||
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, "已收样");//已收样
|
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, "已收样");//已收样
|
||||||
mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getBusinessSubSampleId).orderByAsc(BusinessAssayTaskDataDO::getReportTime);
|
mpjLambdaWrapper.orderByAsc(BusinessAssayTaskDataDO::getBusinessSubSampleId).orderByAsc(BusinessAssayTaskDataDO::getReportTime);
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public interface BusinessAssayTaskDetailMapper extends BaseMapperX<BusinessAssay
|
|||||||
.eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
.betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark())
|
||||||
.orderByDesc(BusinessAssayTaskDetailDO::getId));
|
.orderByAsc(BusinessAssayTaskDetailDO::getSampleCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BusinessAssayTaskDetailExtendRespVO> selectList(BusinessAssayTaskDetailReqVO reqVO) {
|
default List<BusinessAssayTaskDetailExtendRespVO> selectList(BusinessAssayTaskDetailReqVO reqVO) {
|
||||||
@@ -80,7 +80,7 @@ public interface BusinessAssayTaskDetailMapper extends BaseMapperX<BusinessAssay
|
|||||||
.eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(BusinessAssayTaskDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
.betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(BusinessAssayTaskDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BusinessAssayTaskDetailDO::getRemark, reqVO.getRemark())
|
||||||
.orderByDesc(BusinessAssayTaskDetailDO::getId));
|
.orderByAsc(BusinessAssayTaskDetailDO::getSampleCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BusinessAssayTaskDetailDO> selectByBusinessAssayTaskId(Long businessAssayTaskId) {
|
default List<BusinessAssayTaskDetailDO> selectByBusinessAssayTaskId(Long businessAssayTaskId) {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX<BusinessAssayTaskDO
|
|||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
||||||
.selectAll(BusinessAssayTaskDO.class)
|
.selectAll(BusinessAssayTaskDO.class)
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo())
|
.eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo())
|
||||||
.likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName())
|
.likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName())
|
||||||
.eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||||
@@ -73,6 +74,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX<BusinessAssayTaskDO
|
|||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
||||||
.selectAll(BusinessAssayTaskDO.class)
|
.selectAll(BusinessAssayTaskDO.class)
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo())
|
.eqIfPresent(BusinessAssayTaskDO::getTaskNo, reqVO.getTaskNo())
|
||||||
.likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName())
|
.likeIfPresent(BusinessAssayTaskDO::getTaskName, reqVO.getTaskName())
|
||||||
.eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.eqIfPresent(BusinessAssayTaskDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||||
@@ -136,6 +138,7 @@ public interface BusinessAssayTaskMapper extends BaseMapperX<BusinessAssayTaskDO
|
|||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDO::getConfigAssayMethodId)
|
||||||
.selectAll(BusinessAssayTaskDO.class)
|
.selectAll(BusinessAssayTaskDO.class)
|
||||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, BusinessAssayTaskExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.eq(BusinessAssayTaskDO::getId, id));
|
.eq(BusinessAssayTaskDO::getId, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,10 @@ public interface BusinessHandoverRecordSubMapper extends BaseMapperX<BusinessHan
|
|||||||
.eqIfPresent(BusinessHandoverRecordSubDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(BusinessHandoverRecordSubDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
.betweenIfPresent(BusinessHandoverRecordSubDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(BusinessHandoverRecordSubDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(BusinessHandoverRecordSubDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BusinessHandoverRecordSubDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(BusinessHandoverRecordSubDO::getDeptId, reqVO.getDeptId())
|
.eqIfPresent(BusinessSubSampleDO::getSampleAssayCode, reqVO.getSampleAssayCode())
|
||||||
|
.eqIfPresent(BusinessSubSampleDO::getSampleReturnCode, reqVO.getSampleReturnCode())
|
||||||
|
.likeIfPresent(BusinessSubSampleDO::getSampleName, reqVO.getSampleName())
|
||||||
|
.eqIfPresent(BusinessHandoverRecordSubDO::getDeptId, reqVO.getDeptId())
|
||||||
.orderByDesc(BusinessHandoverRecordSubDO::getCreateTime));
|
.orderByDesc(BusinessHandoverRecordSubDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientPa
|
|||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO;
|
||||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
|
|
||||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -41,21 +40,20 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX<Bu
|
|||||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCCoefficientParameterDataReqVO reqVO) {
|
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCCoefficientParameterDataReqVO reqVO) {
|
||||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCCoefficientParameterDataDO>()
|
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCCoefficientParameterDataDO>()
|
||||||
.leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId)
|
.leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId)
|
||||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCCoefficientParameterDataDO::getDictionaryParameterId)
|
|
||||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId)
|
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId)
|
||||||
.selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
.selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
.selectAs(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
.selectAs(ConfigQCSampleMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
.selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
.selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
.selectAs(ConfigQCSampleMethodParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
.selectAs(BusinessQCCoefficientParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
.selectAs(BusinessQCCoefficientParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||||
.selectAs(BusinessQCCoefficientParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
.selectAs(BusinessQCCoefficientParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
.selectAs(ConfigQCSampleMethodParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||||
.selectAs(ConfigQCSampleMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
.selectAs(ConfigQCSampleMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||||
.selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
.selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||||
.selectAs(ConfigQCSampleMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
.selectAs(ConfigQCSampleMethodParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||||
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||||
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||||
|
|||||||
@@ -39,21 +39,20 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX<Bus
|
|||||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCManagementParameterDataReqVO reqVO) {
|
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCManagementParameterDataReqVO reqVO) {
|
||||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCManagementParameterDataDO>()
|
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCManagementParameterDataDO>()
|
||||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId)
|
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCManagementParameterDataDO::getDictionaryParameterId)
|
|
||||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||||
.selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
.selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||||
.selectAs(BusinessQCManagementParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
.selectAs(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||||
.selectAs(BusinessQCManagementParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
.selectAs(BusinessQCManagementParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||||
.selectAs(BusinessQCManagementParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
.selectAs(BusinessQCManagementParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||||
.selectAs(BusinessQCManagementParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
.selectAs(BusinessQCManagementParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX<Busin
|
|||||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId)
|
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId)
|
||||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||||
.selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
.selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||||
.selectAs(BusinessQCManagementProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
.selectAs(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||||
|
|||||||
@@ -82,6 +82,44 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX<BusinessS
|
|||||||
default List<BusinessSampleEntrustDetailDO> selectByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) {
|
default List<BusinessSampleEntrustDetailDO> selectByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) {
|
||||||
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId));
|
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessSampleEntrustDetailExtendRespVO> selectExtendByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) {
|
||||||
|
return selectJoinList(BusinessSampleEntrustDetailExtendRespVO.class, new MPJLambdaWrapperX<BusinessSampleEntrustDetailDO>()
|
||||||
|
.leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId)
|
||||||
|
.selectAll(BusinessSampleEntrustDetailDO.class)
|
||||||
|
.selectAs(BaseSampleDO::getDictionaryBusinessKey, BusinessSampleEntrustDetailExtendRespVO::getSampleTypeDictionaryBusinessKey)
|
||||||
|
.eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BusinessSampleEntrustDetailDO> selectByBusinessSampleEntrustRegistrationIds(List<Long> businessSampleEntrustRegistrationIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
default BusinessSampleEntrustDetailDO selectByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||||
|
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BusinessSampleEntrustDetailDO> selectByBusinessBaseSampleIds(List<Long> businessBaseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询当前批次的第一条数据
|
||||||
|
* @param businessBaseSampleId 任意一条的主样id
|
||||||
|
* @param baseSampleDictionaryBusinessKey 样品大类类型key
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(Long businessBaseSampleId, String baseSampleDictionaryBusinessKey) {
|
||||||
|
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = selectByBusinessBaseSampleId(businessBaseSampleId);
|
||||||
|
//查询当前委托的第一条
|
||||||
|
return selectJoinOne(BusinessSampleEntrustDetailDO.class, new MPJLambdaWrapperX<BusinessSampleEntrustDetailDO>()
|
||||||
|
.leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId)
|
||||||
|
.eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustDetailDO.getBusinessSampleEntrustRegistrationId())
|
||||||
|
.eq(BaseSampleDO::getDictionaryBusinessKey, baseSampleDictionaryBusinessKey)
|
||||||
|
.orderByAsc(BusinessSampleEntrustDetailDO::getSort)
|
||||||
|
.last(" limit 1 "));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物理批量删除删除
|
* 物理批量删除删除
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import java.util.*;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@@ -34,6 +36,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
|||||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark())
|
||||||
.orderByDesc(BusinessSubParentSampleAssessmentDO::getId));
|
.orderByDesc(BusinessSubParentSampleAssessmentDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIds(List<Long> businessSubParentSampleIds) {
|
||||||
|
return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId)
|
||||||
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
default BusinessSubParentSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||||
return selectOne(new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
return selectOne(new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||||
@@ -48,4 +56,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
|||||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds,
|
||||||
|
Long assayDepartmentId) {
|
||||||
|
return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId)
|
||||||
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||||
|
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp
|
|||||||
.orderByDesc(BusinessSubParentSampleAssessmentProjectDO::getId));
|
.orderByDesc(BusinessSubParentSampleAssessmentProjectDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BusinessSubParentSampleAssessmentProjectExtendRespVO> selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
default List<BusinessSubParentSampleAssessmentProjectExtendRespVO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||||
return selectJoinList(BusinessSubParentSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentProjectDO>()
|
return selectJoinList(BusinessSubParentSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentProjectDO>()
|
||||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId)
|
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId)
|
||||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId)
|
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId)
|
||||||
@@ -69,7 +69,7 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp
|
|||||||
.eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<NoReportSubParentSampleAssessmentRespVO> selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId);
|
List<NoReportSubParentSampleAssessmentRespVO> selectNoReportSubParentSampleAssessment(@Param("reqVO") BusinessSubParentSampleAssessmentGroupReqVO reqVO);
|
||||||
|
|
||||||
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId);
|
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,5 +40,15 @@ public interface BusinessSubParentSampleMapper extends BaseMapperX<BusinessSubPa
|
|||||||
.eqIfPresent(BusinessSubParentSampleDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BusinessSubParentSampleDO::getRemark, reqVO.getRemark())
|
||||||
.orderByDesc(BusinessSubParentSampleDO::getId));
|
.orderByDesc(BusinessSubParentSampleDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubParentSampleDO> selectByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleDO>()
|
||||||
|
.eq(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubParentSampleDO> selectByBusinessBaseSampleIds(List<Long> businessBaseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleDO>()
|
||||||
|
.in(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -27,6 +27,7 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
|
|||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||||
.likeIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
.likeIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus())
|
||||||
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getIsSend, reqVO.getIsSend())
|
||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, reqVO.getSampleReceiver())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, reqVO.getSampleReceiver())
|
||||||
.betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, reqVO.getSampleReceiveTime())
|
.betweenIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, reqVO.getSampleReceiveTime())
|
||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
@@ -46,6 +47,12 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
|
|||||||
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds, Long assayDepartmentId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||||
|
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||||
|
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
|
}
|
||||||
|
|
||||||
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleId(Long businessSubSampleId) {
|
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleId(Long businessSubSampleId) {
|
||||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||||
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId));
|
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId));
|
||||||
|
|||||||
@@ -144,8 +144,8 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
|
|||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||||
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus())
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus())
|
||||||
.orderByAsc(BusinessSubSampleDO::getSampleCode)
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getIsSend, reqVO.getIsSendSample())
|
||||||
);
|
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BusinessSubSampleExtendRespVO> selectList(@Valid BusinessSubSampleReqVO reqVO) {
|
default List<BusinessSubSampleExtendRespVO> selectList(@Valid BusinessSubSampleReqVO reqVO) {
|
||||||
|
|||||||
@@ -6,14 +6,18 @@ import java.util.Comparator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||||
import com.yomahub.liteflow.core.NodeComponent;
|
import com.yomahub.liteflow.core.NodeComponent;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.exception.ServiceException;
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
||||||
@@ -44,9 +48,11 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
||||||
@@ -75,6 +81,13 @@ import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委检样 是否有来样品位S值, 是: 综合分析室分析配料元素,试金分析室获取分析的配料元素 ;否:不送往综合分析室,配料时采用来样品位S值,如果是必须含有Cu、S的,则试金分析人员称样时,估一个Cu品位进行配料。
|
||||||
|
*
|
||||||
|
* 商检分析样 这批样中第一个样品默认产生1个配料任务(综合分析室分析),最终这些配料元素对应到这批商检分析样的每一个试金样品的配料参数上;
|
||||||
|
*
|
||||||
|
* 商检综合样 综合样,除了杂质元素,如果要分析Au、Ag,单个样品综合分析室分析配料元素会单独生成1个任务;这个结果匹配到综合样自身的试金任务的配料参数上;
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
|
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
|
||||||
public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||||
@@ -178,47 +191,33 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//样品来样品位
|
//样品来样品位
|
||||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
||||||
|
|
||||||
//金银检测项目字典id列表
|
List<Long> baseSampleIdList = sampleEntrustDetailList.stream().map(m -> m.getBaseSampleId()).distinct().collect(Collectors.toList());
|
||||||
List<Long> auAgDictionaryProjectIdList = new ArrayList<>() {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
{
|
|
||||||
add(1000000000000000002L);
|
|
||||||
add(1000000000000000003L);
|
|
||||||
}};
|
|
||||||
//硫的检测项目字典id
|
|
||||||
Long sDictionaryProjectId = 1000000000000000004L;
|
|
||||||
|
|
||||||
//商检样品来源id
|
|
||||||
List<Long> sjEntrustSourceIdList = new ArrayList<>() {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
{
|
|
||||||
add(1000000000000000002L);//中铜国贸
|
|
||||||
}};
|
|
||||||
|
|
||||||
//样品大类列表
|
//样品大类列表
|
||||||
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectList();
|
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectByIds(baseSampleIdList);
|
||||||
|
|
||||||
//主样配置
|
//主样配置
|
||||||
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectList();
|
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
|
List<Long> configBaseSampleIdList = configBaseSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//分样配置
|
//分样配置
|
||||||
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectList();
|
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
//子样配置
|
//子样配置
|
||||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectList();
|
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
|
List<Long> configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//子样分析方法配置
|
//子样分析方法配置
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectList();
|
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList);
|
||||||
|
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
//分析方法配置
|
//分析方法配置
|
||||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectList();
|
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
||||||
//分析方法检测项目配置
|
//分析方法检测项目配置
|
||||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectList();
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||||
//分析方法检测项目参数配置
|
//分析方法检测项目参数配置
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectList();
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||||
//检测项目字典
|
//检测项目字典
|
||||||
List<DictionaryProjectDO> dictionaryProjectList = dictionaryProjectMapper.selectList();
|
List<DictionaryProjectDO> dictionaryProjectList = dictionaryProjectMapper.selectList();
|
||||||
|
|
||||||
//主样报表配置
|
//主样报表配置
|
||||||
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectList();
|
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectByConfigBaseSampleIds(configBaseSampleIdList);
|
||||||
|
|
||||||
//样品流程配置
|
//样品流程配置
|
||||||
List<String> configSampleFlowKeyList = new ArrayList<>();
|
List<String> configSampleFlowKeyList = new ArrayList<>();
|
||||||
@@ -249,13 +248,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//分析报表数据
|
//分析报表数据
|
||||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
//是否为商检委托
|
|
||||||
Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId());
|
|
||||||
//是否分析金银
|
|
||||||
Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId()));
|
|
||||||
//是否分析硫
|
|
||||||
Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId));
|
|
||||||
|
|
||||||
//子样流转信息列表
|
//子样流转信息列表
|
||||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -263,11 +255,19 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList());
|
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList());
|
||||||
//主样
|
//主样
|
||||||
BusinessBaseSampleDO businessBaseSampleDO = null;
|
BusinessBaseSampleDO businessBaseSampleDO = null;
|
||||||
int sort = 0;//委托明细顺序
|
int sjfxyOne = -1;//商检分析样第一个是值为0,已经过商检分析样的值为1,默认值为-1;
|
||||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细
|
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细
|
||||||
|
|
||||||
//样品大类
|
//样品大类
|
||||||
BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null);
|
BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())){//如果是商检分析样
|
||||||
|
if (sjfxyOne == -1) {
|
||||||
|
sjfxyOne = 0;//第一个商检分析样
|
||||||
|
} else {
|
||||||
|
sjfxyOne = 1;//商检分析样已添加过
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取当前样品的检测项目
|
//获取当前样品的检测项目
|
||||||
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList());
|
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList());
|
||||||
@@ -282,42 +282,17 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<MaterialAssayStandardMethodDO> materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList);
|
List<MaterialAssayStandardMethodDO> materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList);
|
||||||
|
|
||||||
//获取检测方法
|
//获取检测方法
|
||||||
List<Long> configAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
List<Long> materialAssayStandardConfigAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//查找子样配置
|
//查找当前委托明细分析的子样配置
|
||||||
List<Long> configSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && configAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> currentConfigSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && materialAssayStandardConfigAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//查询当前委托样品对应的子样
|
//查询当前委托样品对应的子样
|
||||||
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> currentConfigSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
||||||
if (entrustConfigSubSampleList.size() != 1) {
|
if (entrustConfigSubSampleList.size() != 1) {
|
||||||
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//是否创建综合样S分析
|
|
||||||
Boolean isCreateZhy = false;
|
|
||||||
//综合样分析方法
|
|
||||||
ConfigAssayMethodDO configAssayMethodZhy = null;
|
|
||||||
|
|
||||||
//是商检样品,分析金银,第一个样品
|
|
||||||
if (isSjEntrust && isAssayAuAg && sort == 0) {
|
|
||||||
//是否分析硫
|
|
||||||
isAssayS = dictionaryProjectIdList.contains(sDictionaryProjectId);
|
|
||||||
if (isAssayS) {
|
|
||||||
isCreateZhy = false;
|
|
||||||
} else {
|
|
||||||
isCreateZhy = true;
|
|
||||||
MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId);
|
|
||||||
if (materialAssayStandardMethodDO == null) {
|
|
||||||
throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置");
|
|
||||||
}
|
|
||||||
configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//获取到子样配置
|
//获取到子样配置
|
||||||
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
||||||
Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId();
|
Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId();
|
||||||
@@ -432,14 +407,72 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
|
|
||||||
//子样对应的分析班组
|
//子样对应的分析班组
|
||||||
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null;
|
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null;
|
||||||
|
|
||||||
for (Long configAssayMethodId : configAssayMethodIdList) {
|
for (Long configAssayMethodId : materialAssayStandardConfigAssayMethodIdList) {
|
||||||
//查询分析方法
|
//查询分析方法
|
||||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null);
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null);
|
||||||
|
|
||||||
//查询子样对应的分析方法
|
//查询子样对应的分析方法
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
//扩展配置信息
|
||||||
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
|
ConfigSubSampleMethodConfAdd addAssayTask = configSubSampleMethodConfInfo.getAddAssayTask();
|
||||||
|
if (addAssayTask != null) {//需要添加任务
|
||||||
|
|
||||||
|
List<Long> conditionProjectIdList = addAssayTask.getConditionProjectIdList();
|
||||||
|
Long methodId = addAssayTask.getMethodId();
|
||||||
|
List<Long> projectIdList = addAssayTask.getProjectIdList();
|
||||||
|
//判定检测项目包含条件中的检测项目
|
||||||
|
Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId()));
|
||||||
|
//是否预报S值
|
||||||
|
Boolean isForecastS = false;
|
||||||
|
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||||
|
if (StringUtils.isNotBlank(forecastResult)) {
|
||||||
|
JSONArray array = JSON.parseArray(forecastResult);
|
||||||
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
|
if ("S".equals(item.getString("simpleName"))) {
|
||||||
|
isForecastS = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果是商检样分析,且为第一个商检分析样,并且包含要检测的项目,
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && sjfxyOne == 0) {
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList) {//如果是商检综合样,并且包含需检查的项目
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
|
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && !isForecastS ) {//如果是委检样,包含检测项目,未预报S值
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
//分析班组
|
||||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
if (businessSubSampleAnalysisGroupDO == null) {
|
||||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||||
@@ -482,7 +515,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//根据检测方法循环
|
//根据检测方法循环
|
||||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||||
//根据任务数循环
|
//根据任务数循环
|
||||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||||
//子样检测任务
|
//子样检测任务
|
||||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||||
@@ -500,11 +533,11 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||||
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
@@ -523,9 +556,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
||||||
if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值
|
|
||||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
businessAssayProjectDataDO.setIsEnabled(1);
|
||||||
@@ -548,123 +578,21 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
if (assayProjectBuilder.length() > 1) {
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
}
|
||||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//判定是商检 分析金银 需要创建综合样,样品为第1个
|
|
||||||
if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) {
|
|
||||||
Long configAssayMethodIdZhy = configAssayMethodZhy.getId();
|
|
||||||
Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId();
|
|
||||||
|
|
||||||
//查询子样对应的分析方法
|
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
|
||||||
|
|
||||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(assayDepartmentIdZhy)).findFirst().orElse(null);
|
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
|
||||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
|
||||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
|
||||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
|
||||||
|
|
||||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
//根据任务数判断是平行还是
|
|
||||||
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
|
||||||
|
|
||||||
//分样判定数据
|
|
||||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
|
||||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
|
||||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
|
||||||
|
|
||||||
//子样判定数据
|
|
||||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
|
||||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
|
||||||
|
|
||||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
|
||||||
|
|
||||||
//根据检测方法循环
|
|
||||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
|
||||||
//根据任务数循环
|
|
||||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
|
||||||
//子样检测任务
|
|
||||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
|
||||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
|
||||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessAssayTaskDataDO.setAssayType(assayType);
|
|
||||||
businessAssayTaskDataDO.setTaskType("常规");
|
|
||||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
|
||||||
|
|
||||||
|
|
||||||
//查询S检测项目
|
|
||||||
ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getDictionaryProjectId().equals(sDictionaryProjectId)).findFirst().orElse(null);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//检测项目
|
|
||||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
|
||||||
businessAssayProjectDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
|
||||||
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
|
||||||
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
|
||||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
|
||||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
|
||||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
|
||||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
|
||||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
|
||||||
|
|
||||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList());
|
|
||||||
for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) {
|
|
||||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO();
|
|
||||||
businessAssayParameterDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId());
|
|
||||||
businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId());
|
|
||||||
businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId());
|
|
||||||
businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType());
|
|
||||||
businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition());
|
|
||||||
|
|
||||||
|
|
||||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
businessAssayTaskDataDO.setAssayProject("S");
|
|
||||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sort++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED);
|
sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED);
|
||||||
|
sampleEntrustRegistration.setAssayStatus(QmsCommonConstant.UNCHECKED);
|
||||||
|
sampleEntrustRegistration.setDataStatus(QmsCommonConstant.UNRETURNED);
|
||||||
|
sampleEntrustRegistration.setTaskQuantity(businessAssayTaskDataDOList.size());
|
||||||
|
|
||||||
sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList);
|
sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList);
|
||||||
|
|
||||||
@@ -679,45 +607,165 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessSampleAssayResultMapper.updateBatch(sampleAssayResultList);
|
businessSampleAssayResultMapper.updateBatch(sampleAssayResultList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessBaseSampleDOList)) {
|
if (CollUtil.isNotEmpty(businessBaseSampleDOList)) {
|
||||||
log.info("插入 businessBaseSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessBaseSampleMapper.insertBatch(businessBaseSampleDOList);
|
businessBaseSampleMapper.insertBatch(businessBaseSampleDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) {
|
if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) {
|
||||||
log.info("插入 businessSubParentSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList);
|
businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentDOList)) {
|
if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentDOList)) {
|
||||||
log.info("插入 businessSubParentSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList);
|
businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessSubSampleDOList)) {
|
if (CollUtil.isNotEmpty(businessSubSampleDOList)) {
|
||||||
log.info("插入 businessSubSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessSubSampleMapper.insertBatch(businessSubSampleDOList);
|
businessSubSampleMapper.insertBatch(businessSubSampleDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
||||||
log.info("插入 businessSubSampleAnalysisGroupDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList);
|
businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessSubSampleAssessmentDOList)) {
|
if (CollUtil.isNotEmpty(businessSubSampleAssessmentDOList)) {
|
||||||
log.info("插入 businessSubSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList);
|
businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
||||||
log.info("插入 businessAssayTaskDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
||||||
log.info("插入 businessAssayProjectDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList);
|
businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) {
|
||||||
log.info("插入 businessAssayParameterDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList);
|
businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) {
|
||||||
log.info("插入 businessAssayReportDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
|
||||||
businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList);
|
businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addAssayTask(LocalDateTime currentDateTime, List<ConfigSubSampleMethodDO> configSubSampleMethodList,
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList,
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList,
|
||||||
|
List<DictionaryProjectDO> dictionaryProjectList,
|
||||||
|
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList,
|
||||||
|
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList,
|
||||||
|
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList,
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList,
|
||||||
|
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList,
|
||||||
|
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList, ConfigSubSampleDO configSubSample,
|
||||||
|
ConfigSampleFlowDO configSampleFlowSub, SampleFlowNode sampleFlowNodeSub,
|
||||||
|
BusinessSubSampleDO businessSubSampleDO, Long methodId, List<Long> projectIdList) {
|
||||||
|
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO;
|
||||||
|
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
||||||
|
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
||||||
|
|
||||||
|
//查询子样对应的分析方法
|
||||||
|
ConfigSubSampleMethodDO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
||||||
|
if (businessSubSampleAnalysisGroupDO == null) {
|
||||||
|
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||||
|
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||||
|
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
||||||
|
|
||||||
|
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据任务数判断是平行还是
|
||||||
|
String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||||
|
|
||||||
|
//分样判定数据
|
||||||
|
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||||
|
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||||
|
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||||
|
|
||||||
|
//子样判定数据
|
||||||
|
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||||
|
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||||
|
|
||||||
|
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||||
|
|
||||||
|
//根据检测方法循环
|
||||||
|
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||||
|
//根据任务数循环
|
||||||
|
for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.getTaskCount(); i++) {
|
||||||
|
//子样检测任务
|
||||||
|
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||||
|
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
||||||
|
businessAssayTaskDataDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessAssayTaskDataDO.setAssayType(assayType);
|
||||||
|
businessAssayTaskDataDO.setTaskType("常规");
|
||||||
|
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
|
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||||
|
assayProjectBuilder.append(dictionaryProject.getShowName()).append(",");
|
||||||
|
|
||||||
|
|
||||||
|
//检测项目
|
||||||
|
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
||||||
|
businessAssayProjectDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||||
|
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||||
|
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
||||||
|
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||||
|
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||||
|
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
||||||
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
|
businessAssayProjectDataDO.setIsEnabled(1);
|
||||||
|
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||||
|
|
||||||
|
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList());
|
||||||
|
for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) {
|
||||||
|
BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO();
|
||||||
|
businessAssayParameterDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId());
|
||||||
|
businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId());
|
||||||
|
businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId());
|
||||||
|
businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType());
|
||||||
|
businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition());
|
||||||
|
|
||||||
|
|
||||||
|
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (assayProjectBuilder.length() > 1) {
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
}
|
||||||
|
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||||
|
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent {
|
|||||||
String simpleCode = sequenceUtil.genCode(simpleCodeRule);
|
String simpleCode = sequenceUtil.genCode(simpleCodeRule);
|
||||||
businessSubSampleDO.setSampleAssayCode(simpleCode);
|
businessSubSampleDO.setSampleAssayCode(simpleCode);
|
||||||
businessSubSampleDO.setSampleReturnCode(simpleCode);
|
businessSubSampleDO.setSampleReturnCode(simpleCode);
|
||||||
|
businessSubSampleDO.setIsGenerateReturnCode(QmsCommonConstant.YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,16 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.flow;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.ql.util.express.DefaultContext;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
import com.ql.util.express.ExpressRunner;
|
import com.alibaba.qlexpress4.QLOptions;
|
||||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||||
import com.yomahub.liteflow.core.NodeComponent;
|
import com.yomahub.liteflow.core.NodeComponent;
|
||||||
import com.zt.plat.framework.common.exception.ServiceException;
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
@@ -41,7 +43,7 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
|||||||
// private ConfigSubSampleService configSubSampleService;
|
// private ConfigSubSampleService configSubSampleService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExpressRunner expressRunner;
|
private Express4Runner express4Runner;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ConfigRuleMapper configRuleMapper;
|
private ConfigRuleMapper configRuleMapper;
|
||||||
@@ -89,10 +91,10 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
|||||||
for (SampleFlowNode flowNode : nextFlowNodeList) {
|
for (SampleFlowNode flowNode : nextFlowNodeList) {
|
||||||
ConfigRuleDO conditionRule = configRuleMapper.selectLatestConfigRuleByCode(flowNode.getCondition());
|
ConfigRuleDO conditionRule = configRuleMapper.selectLatestConfigRuleByCode(flowNode.getCondition());
|
||||||
Boolean isMeetCondition = false;
|
Boolean isMeetCondition = false;
|
||||||
DefaultContext<String, Object> context = new DefaultContext<>();
|
Map<String, Object> context = new HashMap<>();
|
||||||
ConfigSubSampleDO configSubSample = sampleFlowContext.getConfigSubSampleById(businessSubSample.getConfigSubSampleId());
|
ConfigSubSampleDO configSubSample = sampleFlowContext.getConfigSubSampleById(businessSubSample.getConfigSubSampleId());
|
||||||
Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule());
|
Boolean hasSubSimpleCodeRule = configSubSample != null && StringUtils.isNotBlank(configSubSample.getSimpleCodeRule());
|
||||||
Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey()));
|
Boolean hasSubSampleEncrypt = businessHandoverRecordSubDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).anyMatch(m -> QmsCommonConstant.FlOW_NODE_SAMPLE_ENCRYPT.equals(m.getSampleFlowNodeKey()));
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
||||||
List<BusinessSubSampleAnalysisGroupDO> curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList());
|
List<BusinessSubSampleAnalysisGroupDO> curSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).collect(Collectors.toList());
|
||||||
@@ -105,7 +107,8 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
|||||||
context.put("hasSubSimpleCodeRule", hasSubSimpleCodeRule);
|
context.put("hasSubSimpleCodeRule", hasSubSimpleCodeRule);
|
||||||
context.put("hasSubSampleEncrypt", hasSubSampleEncrypt);
|
context.put("hasSubSampleEncrypt", hasSubSampleEncrypt);
|
||||||
try {
|
try {
|
||||||
isMeetCondition = (Boolean) expressRunner.execute(conditionRule.getExpression(), context, null, false, false);
|
// isMeetCondition = (Boolean) express4Runner.execute(conditionRule.getExpression(), context, null, false, false);
|
||||||
|
isMeetCondition = (Boolean) express4Runner.execute(conditionRule.getExpression(), context, QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw new ServiceException(1_032_100_000, e.getMessage());
|
throw new ServiceException(1_032_100_000, e.getMessage());
|
||||||
@@ -140,6 +143,16 @@ public class SampleSubProcessUpdateCmp extends NodeComponent {
|
|||||||
}
|
}
|
||||||
sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList);
|
sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//如果是班组送样,需要更新分析班组表
|
||||||
|
if (QmsCommonConstant.FLOW_NODE_ANALYSIS_SEND.equals(currentSampleFlowKey)) {
|
||||||
|
List<BusinessSubSampleAnalysisGroupDO> curDeptSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).collect(Collectors.toList());
|
||||||
|
for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : curDeptSubSampleAnalysisGroupDOList) {
|
||||||
|
businessSubSampleAnalysisGroupDO.setIsSend(QmsCommonConstant.YES);
|
||||||
|
}
|
||||||
|
sampleFlowContext.setBusinessSubSampleAnalysisGroupList(curDeptSubSampleAnalysisGroupDOList);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BusinessAssayTaskDataGroupRespVO> getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) {
|
public List<BusinessAssayTaskDataGroupRespVO> getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
System.out.println("查询时租户id:" + TenantContextHolder.getTenantId());
|
// System.out.println("查询时租户id:" + TenantContextHolder.getTenantId());
|
||||||
return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO);
|
return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import com.zt.plat.framework.common.pojo.PageParam;
|
|||||||
*/
|
*/
|
||||||
public interface BusinessSampleEntrustRegistrationService {
|
public interface BusinessSampleEntrustRegistrationService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建委检登记业务
|
* 创建委检登记业务
|
||||||
*
|
*
|
||||||
@@ -56,6 +58,8 @@ public interface BusinessSampleEntrustRegistrationService {
|
|||||||
*/
|
*/
|
||||||
BusinessSampleEntrustRegistrationDO getBusinessSampleEntrustRegistration(Long id);
|
BusinessSampleEntrustRegistrationDO getBusinessSampleEntrustRegistration(Long id);
|
||||||
|
|
||||||
|
List<BusinessSampleEntrustRegistrationDO> listByIds(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得委检登记业务分页
|
* 获得委检登记业务分页
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ public class BusinessSampleEntrustRegistrationServiceImpl implements BusinessSam
|
|||||||
return businessSampleEntrustRegistrationMapper.selectById(id);
|
return businessSampleEntrustRegistrationMapper.selectById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BusinessSampleEntrustRegistrationDO> listByIds(List<Long> ids) {
|
||||||
|
return businessSampleEntrustRegistrationMapper.selectByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<BusinessSampleEntrustRegistrationExtendRespVO> getBusinessSampleEntrustRegistrationPage(BusinessSampleEntrustRegistrationPageReqVO pageReqVO) {
|
public PageResult<BusinessSampleEntrustRegistrationExtendRespVO> getBusinessSampleEntrustRegistrationPage(BusinessSampleEntrustRegistrationPageReqVO pageReqVO) {
|
||||||
return businessSampleEntrustRegistrationMapper.selectPage(pageReqVO);
|
return businessSampleEntrustRegistrationMapper.selectPage(pageReqVO);
|
||||||
|
|||||||
@@ -242,6 +242,9 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
|||||||
BusinessSubSampleExtendRespVO subSample = null;
|
BusinessSubSampleExtendRespVO subSample = null;
|
||||||
if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(reqVO.getSampleFlowNodeKey())) {
|
if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(reqVO.getSampleFlowNodeKey())) {
|
||||||
subSample = businessSubSampleMapper.getBySampleCode(reqVO);
|
subSample = businessSubSampleMapper.getBySampleCode(reqVO);
|
||||||
|
if (subSample == null) {
|
||||||
|
return subSample;
|
||||||
|
}
|
||||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleId(subSample.getId());
|
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleId(subSample.getId());
|
||||||
BusinessSubSampleAnalysisGroupDO receiveSample = businessSubSampleAnalysisGroupList.stream().filter(f -> "已收样".equals(f.getSampleStatus()) && !f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).findFirst().orElse(null);
|
BusinessSubSampleAnalysisGroupDO receiveSample = businessSubSampleAnalysisGroupList.stream().filter(f -> "已收样".equals(f.getSampleStatus()) && !f.getAssayDepartmentId().equals(loginUser.getVisitDeptId())).findFirst().orElse(null);
|
||||||
if (receiveSample != null) {
|
if (receiveSample != null) {
|
||||||
|
|||||||
@@ -3,18 +3,10 @@ package com.zt.plat.module.qms.business.bus.service;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <b>SampleAnalysisAuditService</b>
|
* <b>SampleAnalysisAuditService</b>
|
||||||
* <p>
|
|
||||||
* 更新历史:
|
|
||||||
* <pre> 版本 更新时间 更新者 更新内容<hr/>
|
|
||||||
* V1.0 2025年9月29日 wxr Add</pre>
|
|
||||||
* <b>Copyright (C) 云南志者竟成科技有限公司</b>
|
|
||||||
* </p>
|
|
||||||
* @author 王兴荣<wxr@wangxingrong.com>
|
|
||||||
* @version V1.0
|
|
||||||
* @since 2025年9月29日
|
|
||||||
*/
|
*/
|
||||||
public interface SampleAnalysisAuditService {
|
public interface SampleAnalysisAuditService {
|
||||||
|
|
||||||
@@ -22,7 +14,7 @@ public interface SampleAnalysisAuditService {
|
|||||||
|
|
||||||
void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus);
|
void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus);
|
||||||
|
|
||||||
JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus);
|
JSONObject getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO);
|
||||||
|
|
||||||
JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId);
|
JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId);
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,10 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.apache.commons.collections4.map.HashedMap;
|
import org.apache.commons.collections4.map.HashedMap;
|
||||||
@@ -23,18 +20,17 @@ import com.alibaba.fastjson2.JSONArray;
|
|||||||
import com.alibaba.fastjson2.JSONFactory;
|
import com.alibaba.fastjson2.JSONFactory;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.alibaba.fastjson2.JSONWriter;
|
import com.alibaba.fastjson2.JSONWriter;
|
||||||
import com.alibaba.nacos.shaded.io.grpc.Attributes.Key;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
|
import com.alibaba.qlexpress4.QLOptions;
|
||||||
|
import com.alibaba.qlexpress4.QLResult;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.ql.util.express.DefaultContext;
|
|
||||||
import com.ql.util.express.ExpressRunner;
|
|
||||||
import com.zt.plat.framework.common.exception.ServiceException;
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
@@ -67,7 +63,6 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO;
|
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||||
@@ -104,7 +99,7 @@ import jakarta.annotation.Resource;
|
|||||||
public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditService {
|
public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExpressRunner expressRunner;
|
private Express4Runner express4Runner;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AllowanceCalculatorComponent allowanceCalculatorComponent;
|
private AllowanceCalculatorComponent allowanceCalculatorComponent;
|
||||||
@@ -152,7 +147,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getSampleResultAssessmentList(Long configAssayMethodId, String asmtReportedStatus) {
|
public JSONObject getSampleResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
|
Long configAssayMethodId = reqVO.getConfigAssayMethodId();
|
||||||
|
String asmtReportedStatus = reqVO.getAsmtReportedStatus();
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
||||||
List<Map<String, Object>> columnList = new ArrayList<>();
|
List<Map<String, Object>> columnList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -173,6 +170,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO();
|
BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO();
|
||||||
search.setConfigAssayMethodId(configAssayMethodId);
|
search.setConfigAssayMethodId(configAssayMethodId);
|
||||||
search.setAsmtReportedStatus(asmtReportedStatus);
|
search.setAsmtReportedStatus(asmtReportedStatus);
|
||||||
|
search.setSampleReceiveTime(reqVO.getSampleReceiveTime());
|
||||||
List<BusinessAssayTaskDataExtendRespVO> resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search);
|
List<BusinessAssayTaskDataExtendRespVO> resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search);
|
||||||
|
|
||||||
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) {
|
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) {
|
||||||
@@ -327,6 +325,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode());
|
map.put("sampleCode", businessAssayTaskDetailDO.getSampleCode());
|
||||||
map.put("sampleName", businessAssayTaskDetailDO.getSampleName());
|
map.put("sampleName", businessAssayTaskDetailDO.getSampleName());
|
||||||
map.put("analysisType", "analysis");
|
map.put("analysisType", "analysis");
|
||||||
|
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||||
|
|
||||||
BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
||||||
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||||
@@ -362,6 +361,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
map.put("sampleCode", businessQCManagementData.getSampleCode());
|
map.put("sampleCode", businessQCManagementData.getSampleCode());
|
||||||
map.put("sampleName", businessQCManagementData.getSampleName());
|
map.put("sampleName", businessQCManagementData.getSampleName());
|
||||||
map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey());
|
map.put("analysisType", businessQCManagementData.getDictionaryBusinessKey());
|
||||||
|
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||||
|
|
||||||
BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO();
|
BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO();
|
||||||
projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
||||||
@@ -395,6 +395,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
map.put("sampleCode", businessQCCoefficientData.getSampleCode());
|
map.put("sampleCode", businessQCCoefficientData.getSampleCode());
|
||||||
map.put("sampleName", businessQCCoefficientData.getSampleName());
|
map.put("sampleName", businessQCCoefficientData.getSampleName());
|
||||||
map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey());
|
map.put("analysisType", businessQCCoefficientData.getDictionaryBusinessKey());
|
||||||
|
map.put("assayTime", businessAssayTaskJson.get("assayTime"));
|
||||||
|
|
||||||
BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO();
|
BusinessQCCoefficientParameterDataReqVO parameterDataSearch2 = new BusinessQCCoefficientParameterDataReqVO();
|
||||||
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
||||||
@@ -436,8 +437,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
|
|
||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||||
if (QmsCommonConstant.APPROVE.equals(auditStatus)) {
|
if (QmsCommonConstant.APPROVE.equals(auditStatus)) {
|
||||||
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.APPROVED);
|
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.COMPLETED);
|
||||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.APPROVED);
|
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.COMPLETED);
|
||||||
businessAssayTaskDO.setReportTime(LocalDateTime.now());
|
businessAssayTaskDO.setReportTime(LocalDateTime.now());
|
||||||
businessAssayTaskDO.setReportOperator(SecurityFrameworkUtils.getLoginUserNickname());
|
businessAssayTaskDO.setReportOperator(SecurityFrameworkUtils.getLoginUserNickname());
|
||||||
businessAssayTaskDO.setReportOperatorId(SecurityFrameworkUtils.getLoginUserId());
|
businessAssayTaskDO.setReportOperatorId(SecurityFrameworkUtils.getLoginUserId());
|
||||||
@@ -640,8 +641,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SAVED);
|
||||||
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.PENDING);
|
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.PENDING);
|
||||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START);
|
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.RETURNED);
|
||||||
}
|
}
|
||||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||||
|
|
||||||
@@ -984,12 +986,14 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
int elementScale = businessSubSampleAssessmentProjectDO.getDecimalPosition();
|
int elementScale = businessSubSampleAssessmentProjectDO.getDecimalPosition();
|
||||||
// 计算代表值(均值\)
|
// 计算代表值(均值\)
|
||||||
// BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale);
|
// BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale);
|
||||||
DefaultContext<String, Object> context = new DefaultContext<>();
|
Map<String, Object> context = new HashMap<>();
|
||||||
context.put("values", sortedValues);
|
context.put("values", sortedValues);
|
||||||
context.put("scale", elementScale);
|
context.put("scale", elementScale);
|
||||||
BigDecimal representativeValue = null;
|
BigDecimal representativeValue = null;
|
||||||
try {
|
try {
|
||||||
representativeValue = (BigDecimal) expressRunner.execute(calculateAssessmentValue.getExpression(), context, null, false, false);
|
//representativeValue = (BigDecimal) expressRunner.execute(calculateAssessmentValue.getExpression(), context, null, false, false);
|
||||||
|
QLResult expressResult = express4Runner.execute(calculateAssessmentValue.getExpression(), context, QLOptions.builder().precise(true).build());//高精度计算
|
||||||
|
representativeValue = (BigDecimal) expressResult.getResult();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <b>SampleAnalysisService</b>
|
* <b>SampleAnalysisService</b>
|
||||||
* <p>
|
|
||||||
* 更新历史:
|
|
||||||
* <pre> 版本 更新时间 更新者 更新内容<hr/>
|
|
||||||
* V1.0 2025年9月22日 wxr Add</pre>
|
|
||||||
* <b>Copyright (C) 云南志者竟成科技有限公司</b>
|
|
||||||
* </p>
|
|
||||||
* @author 王兴荣<wxr@wangxingrong.com>
|
|
||||||
* @version V1.0
|
|
||||||
* @since 2025年9月22日
|
* @since 2025年9月22日
|
||||||
*/
|
*/
|
||||||
public interface SampleAnalysisService {
|
public interface SampleAnalysisService {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.zt.plat.framework.common.exception.ServiceException;
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
@@ -35,6 +37,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataEx
|
|||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
||||||
@@ -45,6 +48,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientP
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||||
@@ -56,6 +61,9 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO;
|
||||||
@@ -64,10 +72,12 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethod
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfItem;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfPoint;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectRangeDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectCoefficientMapper;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper;
|
||||||
@@ -132,10 +142,23 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BaseSampleMapper baseSampleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSubParentSampleMapper businessSubParentSampleMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DataCollectionService dataCollectionService;
|
private DataCollectionService dataCollectionService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
public BusinessAssayTaskAnalysisSampleProjectRespVO batchSampleAnalysisByTaskId(Long businessAssayTaskId) {
|
||||||
BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO();
|
BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO();
|
||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||||
@@ -161,17 +184,27 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
|
||||||
|
|
||||||
|
|
||||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId));
|
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||||
|
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
|
||||||
|
|
||||||
|
//子样Id列表
|
||||||
|
List<Long> businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//子样列表
|
||||||
|
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||||
|
//子样配置id列表
|
||||||
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//子样方法配置列表
|
||||||
|
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
|
||||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||||
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
|
||||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||||
|
|
||||||
@@ -199,24 +232,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
|
|
||||||
// String fieldIndex = "e" + ep.getDicId();
|
|
||||||
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
|
|
||||||
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
|
|
||||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
|
||||||
//
|
|
||||||
// if (StringUtils.isNotEmpty(ep.getFormula())) {
|
|
||||||
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
|
||||||
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
|
||||||
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
|
||||||
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
|
||||||
// fieldIndex = "p" + p.getDicId();
|
|
||||||
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
|
|
||||||
// isEdit = StringUtils.isBlank(p.getFormula());
|
|
||||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns);
|
businessAssayTaskAnalysisSampleProjectRespVO.setColumns(cloumns);
|
||||||
|
|
||||||
|
|
||||||
@@ -225,6 +240,91 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
||||||
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
||||||
|
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
|
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||||
|
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) {
|
||||||
|
//Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须
|
||||||
|
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源
|
||||||
|
Long configMethodId = source.getMethodId();
|
||||||
|
String sourceProject = source.getProject();
|
||||||
|
//String sourceParameter = source.getParameter();
|
||||||
|
|
||||||
|
|
||||||
|
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标
|
||||||
|
String targetProject = target.getProject();
|
||||||
|
String targetParameter = target.getParameter();
|
||||||
|
|
||||||
|
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||||
|
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||||
|
//1 查询委托明细
|
||||||
|
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||||
|
//2 查询样品大类
|
||||||
|
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||||
|
//3 判断样品大类类型
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||||
|
//查询当前批次的第一个商检分析样
|
||||||
|
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||||
|
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||||
|
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||||
|
//查询当前样品的其他分析方法的结果
|
||||||
|
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||||
|
//查询来样品位
|
||||||
|
Boolean isForecastS = false;
|
||||||
|
String forecastValue = null;
|
||||||
|
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||||
|
if (StringUtils.isNotBlank(forecastResult)) {
|
||||||
|
JSONArray array = JSON.parseArray(forecastResult);
|
||||||
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
|
if ("S".equals(item.getString("simpleName"))) {
|
||||||
|
isForecastS = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
|
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||||
|
forecastValue = item.getString("value");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||||
|
businessAssayParameterDataDO.setValue(forecastValue);
|
||||||
|
} else {
|
||||||
|
//查询当前样品的其他方法的结果
|
||||||
|
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, Object> map = new HashedMap<>();
|
Map<String, Object> map = new HashedMap<>();
|
||||||
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
||||||
map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId());
|
map.put("businessAssayTaskId", businessAssayTaskDataDO.getBusinessAssayTaskId());
|
||||||
@@ -389,6 +489,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) {
|
public BusinessAssayTaskAnalysisSampleAndQcProjectRespVO batchSampleAndQcAnalysisByTaskId(Long businessAssayTaskId) {
|
||||||
BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProjectRespVO = new BusinessAssayTaskAnalysisSampleAndQcProjectRespVO();
|
BusinessAssayTaskAnalysisSampleAndQcProjectRespVO businessAssayTaskAnalysisSampleAndQcProjectRespVO = new BusinessAssayTaskAnalysisSampleAndQcProjectRespVO();
|
||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||||
@@ -421,9 +522,6 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
assayTaskAnalysisDataList.add(analysis);
|
assayTaskAnalysisDataList.add(analysis);
|
||||||
|
|
||||||
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTaskAnalysisDataList(assayTaskAnalysisDataList);
|
businessAssayTaskAnalysisSampleAndQcProjectRespVO.setAssayTaskAnalysisDataList(assayTaskAnalysisDataList);
|
||||||
|
|
||||||
// List<ConfigQCSampleMethodExtendRespVO> configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId());
|
|
||||||
// businessAssayTaskAnalysisSampleAndQcProjectRespVO.setConfigQCSampleMethodList(configQCSampleMethodList);
|
|
||||||
|
|
||||||
//查询区间范围
|
//查询区间范围
|
||||||
List<ConfigAssayMethodProjectRangeDO> configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectRangeDO>().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
List<ConfigAssayMethodProjectRangeDO> configAssayMethodProjectRangeDOList = configAssayMethodProjectRangeMapper.selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectRangeDO>().eq(ConfigAssayMethodProjectRangeDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||||
@@ -446,17 +544,26 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
//处理列
|
//处理列
|
||||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
|
||||||
|
|
||||||
|
|
||||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||||
|
|
||||||
|
//子样Id列表
|
||||||
|
List<Long> businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//子样列表
|
||||||
|
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||||
|
//子样配置id列表
|
||||||
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//子样方法配置列表
|
||||||
|
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
|
||||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
// BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
|
||||||
|
|
||||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||||
// projectDataSearch.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
|
||||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||||
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
|
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
|
||||||
@@ -482,24 +589,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList) {
|
|
||||||
// String fieldIndex = "e" + ep.getDicId();
|
|
||||||
// String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")");
|
|
||||||
// boolean isEdit = StringUtils.isBlank(ep.getFormula());
|
|
||||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
|
||||||
//
|
|
||||||
// if (StringUtils.isNotEmpty(ep.getFormula())) {
|
|
||||||
// BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
|
||||||
// parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
|
||||||
// List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
|
||||||
// for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
|
||||||
// fieldIndex = "p" + p.getDicId();
|
|
||||||
// title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
|
|
||||||
// isEdit = StringUtils.isBlank(p.getFormula());
|
|
||||||
// cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
businessAssayTaskAnalysisDataRespVO.setColumns(cloumns);
|
businessAssayTaskAnalysisDataRespVO.setColumns(cloumns);
|
||||||
|
|
||||||
|
|
||||||
@@ -507,6 +597,91 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
List<Map<String, Object>> datas = new ArrayList<>();
|
List<Map<String, Object>> datas = new ArrayList<>();
|
||||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
||||||
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
||||||
|
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
|
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||||
|
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) {
|
||||||
|
//Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须
|
||||||
|
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源
|
||||||
|
Long configMethodId = source.getMethodId();
|
||||||
|
String sourceProject = source.getProject();
|
||||||
|
//String sourceParameter = source.getParameter();
|
||||||
|
|
||||||
|
|
||||||
|
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标
|
||||||
|
String targetProject = target.getProject();
|
||||||
|
String targetParameter = target.getParameter();
|
||||||
|
|
||||||
|
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||||
|
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||||
|
//1 查询委托明细
|
||||||
|
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||||
|
//2 查询样品大类
|
||||||
|
BaseSampleDO baseSampleDO = baseSampleMapper.selectById(businessSampleEntrustDetailDO.getBaseSampleId());
|
||||||
|
//3 判断样品大类类型
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检分析样
|
||||||
|
//查询当前批次的第一个商检分析样
|
||||||
|
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(businessAssayTaskDataDO.getBusinessBaseSampleId(), QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE);
|
||||||
|
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||||
|
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是商检综合样
|
||||||
|
//查询当前样品的其他分析方法的结果
|
||||||
|
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())) {//如果是委检样
|
||||||
|
//查询来样品位
|
||||||
|
Boolean isForecastS = false;
|
||||||
|
String forecastValue = null;
|
||||||
|
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||||
|
if (StringUtils.isNotBlank(forecastResult)) {
|
||||||
|
JSONArray array = JSON.parseArray(forecastResult);
|
||||||
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
|
if ("S".equals(item.getString("simpleName"))) {
|
||||||
|
isForecastS = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
|
if (sourceProject.equals(item.getString("simpleName"))) {
|
||||||
|
forecastValue = item.getString("value");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isForecastS) {//来样品位存在S值, 则取预报的值
|
||||||
|
businessAssayParameterDataDO.setValue(forecastValue);
|
||||||
|
} else {
|
||||||
|
//查询当前样品的其他方法的结果
|
||||||
|
List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||||
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||||
|
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||||
|
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||||
|
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> map = new HashedMap<>();
|
Map<String, Object> map = new HashedMap<>();
|
||||||
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
||||||
@@ -923,8 +1098,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||||
businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SUBMITTED);
|
businessAssayTaskDO.setTaskAssayStatus(QmsCommonConstant.SUBMITTED);
|
||||||
businessAssayTaskDO.setAssaySubmitTime(LocalDateTime.now());
|
businessAssayTaskDO.setAssaySubmitTime(LocalDateTime.now());
|
||||||
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.NOT_START);
|
businessAssayTaskDO.setFinishStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START);
|
businessAssayTaskDO.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,7 +1205,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
|
businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.business.bus.service;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -114,21 +115,22 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
sampleEntrustRegistration.put(key, value);
|
sampleEntrustRegistration.put(key, value);
|
||||||
});
|
});
|
||||||
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
List<BusinessSampleEntrustDetailExtendRespVO> sampleEntrustDetailExtendRespVOList = businessSampleEntrustDetailMapper.selectExtendByBusinessSampleEntrustRegistrationId(id);
|
||||||
jsonArray.add(sampleEntrustRegistration);
|
for (BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO : sampleEntrustDetailExtendRespVOList) {
|
||||||
|
List<BusinessSampleEntrustProjectExtendRespVO> businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailExtendRespVO.getId());
|
||||||
List<BusinessSampleEntrustDetailExtendRespVO> sampleEntrustDetailExtendRespVOList = new ArrayList<>();
|
|
||||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationId(id);
|
|
||||||
BusinessSampleEntrustDetailExtendRespVO businessSampleEntrustDetailExtendRespVO = null;
|
|
||||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailList) {
|
|
||||||
businessSampleEntrustDetailExtendRespVO = BeanUtils.toBean(businessSampleEntrustDetailDO, BusinessSampleEntrustDetailExtendRespVO.class);
|
|
||||||
|
|
||||||
List<BusinessSampleEntrustProjectExtendRespVO> businessSampleEntrustProjectExtendRespVOList = businessSampleEntrustProjectMapper.selectByBusinessSampleEntrustDetailId(businessSampleEntrustDetailDO.getId());
|
|
||||||
|
|
||||||
businessSampleEntrustDetailExtendRespVO.setSampleEntrustDetailProjectList(businessSampleEntrustProjectExtendRespVOList);
|
businessSampleEntrustDetailExtendRespVO.setSampleEntrustDetailProjectList(businessSampleEntrustProjectExtendRespVOList);
|
||||||
|
|
||||||
sampleEntrustDetailExtendRespVOList.add(businessSampleEntrustDetailExtendRespVO);
|
|
||||||
}
|
}
|
||||||
|
//样品类型分组统计
|
||||||
|
Map<String, Long> groupMap = sampleEntrustDetailExtendRespVOList.stream().collect(Collectors.groupingBy(BusinessSampleEntrustDetailExtendRespVO::getSampleTypeDictionaryBusinessKey, Collectors.counting()));
|
||||||
|
for (Map.Entry<String, Long> entry : groupMap.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
Long val = entry.getValue();
|
||||||
|
sampleEntrustRegistration.put(key + "Count", val);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONArray jsonArray = new JSONArray();
|
||||||
|
jsonArray.add(sampleEntrustRegistration);
|
||||||
|
|
||||||
String sampleEntrustDetailJsonString = JSON.toJSONString(sampleEntrustDetailExtendRespVOList, context);
|
String sampleEntrustDetailJsonString = JSON.toJSONString(sampleEntrustDetailExtendRespVOList, context);
|
||||||
result.put("sampleEntrustRegistration", jsonArray);
|
result.put("sampleEntrustRegistration", jsonArray);
|
||||||
@@ -250,6 +252,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("提交委托登记失败", response.getCause());
|
log.error("提交委托登记失败", response.getCause());
|
||||||
|
response.getCause().printStackTrace();
|
||||||
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public interface SampleResultReportingService {
|
|||||||
|
|
||||||
List<BusinessSubParentSampleAssessmentGroupRespVO> getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO);
|
List<BusinessSubParentSampleAssessmentGroupRespVO> getUnReportMethodGroupList(BusinessSubParentSampleAssessmentGroupReqVO reqVO);
|
||||||
|
|
||||||
JSONObject getSampleResultReportingList(Long configAssayMethodId);
|
JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO);
|
||||||
|
|
||||||
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId);
|
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId);
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDa
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentProjectDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||||
@@ -48,6 +50,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMa
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustRegistrationMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||||
@@ -111,8 +115,8 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getSampleResultReportingList(Long configAssayMethodId) {
|
public JSONObject getSampleResultReportingList(BusinessSubParentSampleAssessmentGroupReqVO reqVO) {
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId());
|
||||||
List<Map<String, Object>> columnList = new ArrayList<>();
|
List<Map<String, Object>> columnList = new ArrayList<>();
|
||||||
|
|
||||||
//动态字段
|
//动态字段
|
||||||
@@ -132,7 +136,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||||
|
|
||||||
//查询结果报送未上报的样品
|
//查询结果报送未上报的样品
|
||||||
List<NoReportSubParentSampleAssessmentRespVO> noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId);
|
List<NoReportSubParentSampleAssessmentRespVO> noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentProjectMapper.selectNoReportSubParentSampleAssessment(reqVO);
|
||||||
|
|
||||||
if (CollUtil.isEmpty(noReportSubParentSampleAssessmentRespList)) {//没有查询到未上报的数据
|
if (CollUtil.isEmpty(noReportSubParentSampleAssessmentRespList)) {//没有查询到未上报的数据
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
@@ -144,18 +148,18 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
//分样id列表
|
//分样id列表
|
||||||
List<Long> businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList());
|
List<Long> businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList());
|
||||||
//报送的检测项目数据
|
//报送的检测项目数据
|
||||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId());
|
||||||
//获取分析任务数
|
//获取分析任务数
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId());
|
||||||
List<Long> businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
//获取子样数据
|
//获取子样数据
|
||||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds);
|
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds);
|
||||||
|
|
||||||
//获取结果判定数据
|
//获取结果判定数据
|
||||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId());
|
||||||
|
|
||||||
//获取复测业务数据
|
//获取复测业务数据
|
||||||
List<BusinessSubSampleParentRecheckDO> businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
List<BusinessSubSampleParentRecheckDO> businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, reqVO.getConfigAssayMethodId());
|
||||||
|
|
||||||
//循环未上报的样品
|
//循环未上报的样品
|
||||||
for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) {
|
for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) {
|
||||||
@@ -166,6 +170,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
Map<String, Object> subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
Map<String, Object> subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
||||||
Map<String, Object> subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
Map<String, Object> subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
||||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||||
|
noReportSubParentSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime());
|
||||||
noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果");
|
noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果");
|
||||||
StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder();
|
StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder();
|
||||||
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) {
|
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) {
|
||||||
@@ -183,6 +188,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId());
|
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId());
|
||||||
StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder();
|
StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder();
|
||||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) {
|
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) {
|
||||||
|
subSampleAssessmentBeforeMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime());
|
||||||
subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
||||||
subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
||||||
businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
||||||
@@ -198,6 +204,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
List<BusinessSubSampleAssessmentProjectExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||||
StringBuilder businessSubSampleAssessmentIds = new StringBuilder();
|
StringBuilder businessSubSampleAssessmentIds = new StringBuilder();
|
||||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) {
|
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) {
|
||||||
|
subSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime());
|
||||||
subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
||||||
subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
||||||
businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
||||||
@@ -422,6 +429,12 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSampleEntrustRegistrationMapper businessSampleEntrustRegistrationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private SampleFlowService sampleFlowService;
|
private SampleFlowService sampleFlowService;
|
||||||
@@ -433,19 +446,17 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
//当前登录用户昵称
|
//当前登录用户昵称
|
||||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
|
||||||
|
List<BusinessSampleEntrustRegistrationDO> updatebBusinessSampleEntrustRegistrationDOList = new ArrayList<>();
|
||||||
List<BusinessSubSampleDO> updateBusinessSubSampleDOList = new ArrayList<>();
|
List<BusinessSubSampleDO> updateBusinessSubSampleDOList = new ArrayList<>();
|
||||||
List<BusinessSubSampleAnalysisGroupDO> updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>();
|
List<BusinessSubSampleAnalysisGroupDO> updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>();
|
||||||
|
|
||||||
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||||
|
|
||||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||||
|
|
||||||
// List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
|
||||||
|
|
||||||
//循环分样主样数据
|
//循环分样主样数据
|
||||||
for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) {
|
for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) {
|
||||||
|
|
||||||
@@ -490,7 +501,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList());
|
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList());
|
||||||
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
||||||
Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId();
|
Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId();
|
||||||
List<ConfigProjectExtendRespVO> configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList());
|
List<ConfigProjectExtendRespVO> configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId() != null && f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList());
|
||||||
for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) {
|
for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) {
|
||||||
//查询动态报表字段
|
//查询动态报表字段
|
||||||
ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null);
|
ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null);
|
||||||
@@ -538,33 +549,48 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理子样分析任务数据
|
//分析方法信息
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(reqVO.getConfigAssayMethodId());
|
||||||
List<Long> businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
//查询当前分析部门下的分样判定信息
|
||||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId());
|
||||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
//查询当前分析部门下的子样分析班组信息
|
||||||
//根据子样id进行分组
|
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId());
|
||||||
Map<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId));
|
for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : businessSubSampleAnalysisGroupDOList) {//循环分析班组信息
|
||||||
for (Map.Entry<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOEntry : businessAssayTaskDataDOMap.entrySet()) {
|
//查询当前分样判定上报未上报的,并排除当前上报的方法,的数量
|
||||||
Long businessSubSampleId = businessAssayTaskDataDOEntry.getKey();
|
long count = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleAnalysisGroupDO.getBusinessSubParentSampleId()) && !f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
||||||
//子样下的分析任务
|
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||||
List<BusinessAssayTaskDataDO> valList = businessAssayTaskDataDOEntry.getValue();
|
continue;
|
||||||
//查询子样
|
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> businessSubSampleId.equals(f.getId())).findFirst().orElse(null);
|
|
||||||
//查询子样下的分析班组
|
|
||||||
List<BusinessSubSampleAnalysisGroupDO> subSampleAnalysisGroupList = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleId)).collect(Collectors.toList());
|
|
||||||
for (BusinessSubSampleAnalysisGroupDO subSampleAnalysisGroupDO : subSampleAnalysisGroupList) {
|
|
||||||
long count = valList.stream().filter(f -> f.getIsReported().equals(QmsCommonConstant.NO) && f.getAssayDepartmentId().equals(subSampleAnalysisGroupDO.getAssayDepartmentId())).count();
|
|
||||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
subSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成
|
|
||||||
updateBusinessSubSampleAnalysisGroupDOList.add(subSampleAnalysisGroupDO);
|
|
||||||
|
|
||||||
updateBusinessSubSampleDOList.add(businessSubSampleDO);
|
|
||||||
}
|
}
|
||||||
|
businessSubSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成
|
||||||
|
updateBusinessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||||
|
//查询子样
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleAnalysisGroupDO.getBusinessSubSampleId());
|
||||||
|
updateBusinessSubSampleDOList.add(businessSubSampleDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理委托登记信息
|
||||||
|
List<Long> businessBaseSampleIdList = businessSubParentSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<BusinessSampleEntrustDetailDO> businessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleIds(businessBaseSampleIdList);
|
||||||
|
List<Long> businessSampleEntrustRegistrationIdList = businessSampleEntrustDetailDOList.stream().map(m -> m.getBusinessSampleEntrustRegistrationId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<BusinessSampleEntrustRegistrationDO> businessSampleEntrustRegistrationDOList = businessSampleEntrustRegistrationMapper.selectByIds(businessSampleEntrustRegistrationIdList);
|
||||||
|
|
||||||
|
List<BusinessSampleEntrustDetailDO> allBusinessSampleEntrustDetailDOList = businessSampleEntrustDetailMapper.selectByBusinessSampleEntrustRegistrationIds(businessSampleEntrustRegistrationIdList);
|
||||||
|
|
||||||
|
for (BusinessSampleEntrustRegistrationDO businessSampleEntrustRegistrationDO : businessSampleEntrustRegistrationDOList) {
|
||||||
|
List<Long> currentBusinessBaseSampleIdList = allBusinessSampleEntrustDetailDOList.stream().filter(f -> f.getBusinessSampleEntrustRegistrationId().equals(businessSampleEntrustRegistrationDO.getId())).map(m -> m.getBusinessBaseSampleId()).collect(Collectors.toList());
|
||||||
|
List<BusinessSubParentSampleDO> currentBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleIds(currentBusinessBaseSampleIdList);
|
||||||
|
List<Long> currentBusinessSubParentSampleIdList = currentBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
List<BusinessSubParentSampleAssessmentDO> currentBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIds(currentBusinessSubParentSampleIdList);
|
||||||
|
|
||||||
|
//排除不在reqVO.getBusinessSubParentSampleIds()并且方法reqVO.getConfigAssayMethodId()的数据,其他数据校验是否已上报
|
||||||
|
long count = currentBusinessSubParentSampleAssessmentDOList.stream().filter(f -> !(reqVO.getBusinessSubParentSampleIds().contains(f.getBusinessSubParentSampleId()) && f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId())) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
||||||
|
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
businessSampleEntrustRegistrationDO.setAssayStatus(QmsCommonConstant.CHECKED);
|
||||||
|
updatebBusinessSampleEntrustRegistrationDOList.add(businessSampleEntrustRegistrationDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (saveBusinessAssayReportDataDOList.size() > 0) {
|
if (saveBusinessAssayReportDataDOList.size() > 0) {
|
||||||
@@ -594,6 +620,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds())
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleIds())
|
||||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()));
|
||||||
|
|
||||||
|
if (updatebBusinessSampleEntrustRegistrationDOList.size() > 0) {
|
||||||
|
businessSampleEntrustRegistrationMapper.updateBatch(updatebBusinessSampleEntrustRegistrationDOList);
|
||||||
|
}
|
||||||
|
|
||||||
if (updateBusinessSubSampleDOList.size() > 0) {
|
if (updateBusinessSubSampleDOList.size() > 0) {
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ public interface SampleTaskAssignService {
|
|||||||
*/
|
*/
|
||||||
List<AdminUserRespDTO> getAssignUserList();
|
List<AdminUserRespDTO> getAssignUserList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id获取用户信息
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
AdminUserRespDTO getUserInfoById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未指派任务子样信息
|
* 获取未指派任务子样信息
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -176,6 +176,12 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
return userListResult.getCheckedData();
|
return userListResult.getCheckedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AdminUserRespDTO getUserInfoById(Long userId) {
|
||||||
|
CommonResult<AdminUserRespDTO> useResult = adminUserApi.getUser(userId);
|
||||||
|
return useResult.getCheckedData();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UnAssignTaskedSubSampleRespVO> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
public List<UnAssignTaskedSubSampleRespVO> getAssaySampleList(BusinessAssayTaskDataReqVO reqVO) {
|
||||||
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO);
|
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample(reqVO);
|
||||||
@@ -208,6 +214,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
jsonObject = new JSONObject();
|
jsonObject = new JSONObject();
|
||||||
jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId());
|
jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId());
|
||||||
jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName());
|
jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName());
|
||||||
|
jsonObject.put("configAssayMethodNameAndCategory", configSubSampleMethod.getConfigAssayMethodNameAndCategory());
|
||||||
jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode());
|
jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode());
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|||||||
@@ -99,6 +99,13 @@ public class BaseSampleController implements BusinessControllerMarker {
|
|||||||
PageResult<BaseSampleDO> pageResult = baseSampleService.getBaseSamplePage(pageReqVO);
|
PageResult<BaseSampleDO> pageResult = baseSampleService.getBaseSamplePage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class));
|
return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "获得样品大类管理列表")
|
||||||
|
public CommonResult<?> getBaseSampleList(BaseSamplePageReqVO reqVO) {
|
||||||
|
List<BaseSampleRespVO> list = baseSampleService.getBaseSampleList(reqVO);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出样品大类管理 Excel")
|
@Operation(summary = "导出样品大类管理 Excel")
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.admin;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import jakarta.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.service.ConfigEntrustSourceSampleTypeService;
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 检验委托来源与样品类型配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/config-entrust-source-sample-type")
|
||||||
|
@Validated
|
||||||
|
public class ConfigEntrustSourceSampleTypeController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigEntrustSourceSampleTypeService configEntrustSourceSampleTypeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:create')")
|
||||||
|
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> createConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) {
|
||||||
|
return success(configEntrustSourceSampleTypeService.createConfigEntrustSourceSampleType(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:update')")
|
||||||
|
public CommonResult<Boolean> updateConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) {
|
||||||
|
configEntrustSourceSampleTypeService.updateConfigEntrustSourceSampleType(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除检验委托来源与样品类型配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||||
|
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleType(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteConfigEntrustSourceSampleTypeList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleTypeListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得检验委托来源与样品类型配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||||
|
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> getConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||||
|
ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleType(id);
|
||||||
|
return success(BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得检验委托来源与样品类型配置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||||
|
public CommonResult<PageResult<ConfigEntrustSourceSampleTypeRespVO>> getConfigEntrustSourceSampleTypePage(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO) {
|
||||||
|
PageResult<ConfigEntrustSourceSampleTypeDO> pageResult = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出检验委托来源与样品类型配置 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportConfigEntrustSourceSampleTypeExcel(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ConfigEntrustSourceSampleTypeDO> list = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "检验委托来源与样品类型配置.xls", "数据", ConfigEntrustSourceSampleTypeRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,109 +3,41 @@ package com.zt.plat.module.qms.business.config.controller.admin;
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplatePageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplatePageReqVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateSaveReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigReportTemplateSaveReqVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.util.UriUtils;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.commons.text.StringEscapeUtils;
|
|
||||||
import org.springframework.core.io.ByteArrayResource;
|
|
||||||
import org.springframework.core.io.FileSystemResource;
|
|
||||||
import org.springframework.core.io.support.ResourceRegion;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import jakarta.servlet.http.*;
|
import jakarta.servlet.http.*;
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.exception.ServiceException;
|
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.common.util.servlet.ServletUtils;
|
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
import com.zt.plat.framework.security.config.SecurityProperties;
|
|
||||||
import com.zt.plat.framework.security.core.LoginUser;
|
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.codec.Base64;
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.hutool.http.HttpRequest;
|
|
||||||
import cn.hutool.http.HttpResponse;
|
|
||||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO;
|
||||||
import com.zt.plat.module.qms.enums.ErrorCodeConstants;
|
|
||||||
import com.zt.plat.module.qms.framework.gridreport.GridReport;
|
|
||||||
import com.zt.plat.module.qms.framework.gridreport.PdfHelper;
|
|
||||||
import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException;
|
|
||||||
import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService;
|
import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService;
|
||||||
import gridreport.jni.BinaryObject;
|
|
||||||
import gridreport.jni.ExportImageType;
|
|
||||||
import gridreport.jni.ExportType;
|
|
||||||
import gridreport.jni.Report;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 报表模版配置")
|
@Tag(name = "管理后台 - 报表模版配置")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/config-report-template")
|
@RequestMapping("/qms/config-report-template")
|
||||||
@Validated
|
@Validated
|
||||||
@Slf4j
|
public class ConfigReportTemplateController implements BusinessControllerMarker {
|
||||||
public class ConfigReportTemplateController {
|
|
||||||
|
|
||||||
public static final String WR_PREFIX = "_WR_";
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private GridReport gridReport;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SecurityProperties securityProperties;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ConfigReportTemplateService configReportTemplateService;
|
private ConfigReportTemplateService configReportTemplateService;
|
||||||
|
|
||||||
@GetMapping("/info")
|
|
||||||
@Operation(summary = "获取报表信息")
|
|
||||||
public CommonResult<?> info() {
|
|
||||||
Map<String, Object> data = new HashMap<>();
|
|
||||||
try {
|
|
||||||
String moduleInfo = Report.getModuleInfo();
|
|
||||||
String moduleVersion = Report.getModuleVersion();
|
|
||||||
String modulePath = Report.getModulePath();
|
|
||||||
data.put("moduleInfo", moduleInfo);
|
|
||||||
data.put("moduleVersion", moduleVersion);
|
|
||||||
data.put("modulePath", modulePath);
|
|
||||||
} catch (Exception e) {
|
|
||||||
}
|
|
||||||
return success(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建报表模版配置")
|
@Operation(summary = "创建报表模版配置")
|
||||||
@@ -179,460 +111,4 @@ public class ConfigReportTemplateController {
|
|||||||
BeanUtils.toBean(list, ConfigReportTemplateRespVO.class));
|
BeanUtils.toBean(list, ConfigReportTemplateRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
|
||||||
* 预览报表
|
|
||||||
* @param reportId
|
|
||||||
* @param reportKey
|
|
||||||
* @param dataUrl
|
|
||||||
* @param isCrypto
|
|
||||||
* @param type
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@GetMapping("/preview")
|
|
||||||
@Operation(summary = "预览报表")
|
|
||||||
public ResponseEntity<org.springframework.core.io.Resource> preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
|
||||||
ConfigReportTemplateDO gridppReportFile = null;
|
|
||||||
if (reportId != null) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
|
||||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
|
||||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
|
||||||
|
|
||||||
//报表参数
|
|
||||||
Map<String, String> reportParams = new HashMap<>();
|
|
||||||
//获取当前用户姓名
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
String realName = "";
|
|
||||||
if (user != null) {
|
|
||||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
|
||||||
}
|
|
||||||
reportParams.put("operName", realName);
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(dataUrl)) {
|
|
||||||
log.info("url:" + dataUrl);
|
|
||||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
|
||||||
log.info("url:" + dataUrl);
|
|
||||||
//处理url参数
|
|
||||||
if(dataUrl.contains("?")) {
|
|
||||||
String urlParam = dataUrl.split("\\?")[1];
|
|
||||||
String[] urlVks = urlParam.split("&");
|
|
||||||
for (int i = 0; i < urlVks.length; i++) {
|
|
||||||
String vk = urlVks[i];
|
|
||||||
if (StrUtil.isNotBlank(vk)) {
|
|
||||||
String[] vkSplit = vk.split("=");
|
|
||||||
if(vkSplit.length == 2){
|
|
||||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, String> headers = new HashMap<>();
|
|
||||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
|
||||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
|
||||||
headers.put(securityProperties.getTokenHeader(), token);
|
|
||||||
HttpResponse res = HttpRequest.get(dataUrl)
|
|
||||||
.addHeaders(headers)
|
|
||||||
.setConnectionTimeout(60 * 1000)
|
|
||||||
.setReadTimeout(120 * 1000)
|
|
||||||
.execute();
|
|
||||||
if (res.getStatus() != 200) {
|
|
||||||
log.error("报表数据,网络请求错误!", res.body());
|
|
||||||
throw new GridReportException("报表数据,网络请求错误!");
|
|
||||||
}
|
|
||||||
String body = res.body();
|
|
||||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
|
||||||
if (dataR != null && dataR.getCode() == 0) {
|
|
||||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
|
||||||
reportData = JSON.toJSONString(dataR);
|
|
||||||
} else {
|
|
||||||
reportData = JSON.toJSONString(dataR.getData());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.error("获取报表数据错误!", dataR.getMsg());
|
|
||||||
log.error("报表数据:" + reportData);
|
|
||||||
throw new GridReportException("获取报表数据错误!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
|
||||||
MediaType mediaType = null;
|
|
||||||
byte[] docBytes = null;
|
|
||||||
//文件扩展名
|
|
||||||
String fileExtName = type.toLowerCase();
|
|
||||||
switch (type.toUpperCase()) {
|
|
||||||
case "PDF":
|
|
||||||
mediaType = MediaType.APPLICATION_PDF;
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "OFD":
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "RTF":
|
|
||||||
fileExtName = "doc";
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/previewDocs")
|
|
||||||
@Operation(summary = "报告预览报表")
|
|
||||||
public ResponseEntity<org.springframework.core.io.Resource> previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
|
||||||
ConfigReportTemplateDO gridppReportFile = null;
|
|
||||||
if (reportId != null) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
|
||||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
|
||||||
throw new GridReportException("未找到报表模板!");
|
|
||||||
}
|
|
||||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
|
||||||
|
|
||||||
//报表参数
|
|
||||||
Map<String, String> reportParams = new HashMap<>();
|
|
||||||
//获取当前用户姓名
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
String realName = "";
|
|
||||||
if (user != null) {
|
|
||||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
|
||||||
}
|
|
||||||
reportParams.put("operName", realName);
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(dataUrl)) {
|
|
||||||
log.info("url:" + dataUrl);
|
|
||||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
|
||||||
log.info("url:" + dataUrl);
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, String> headers = new HashMap<>();
|
|
||||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
|
||||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
|
||||||
headers.put(securityProperties.getTokenHeader(), token);
|
|
||||||
HttpResponse res = HttpRequest.get(dataUrl)
|
|
||||||
.addHeaders(headers)
|
|
||||||
.setConnectionTimeout(60 * 1000)
|
|
||||||
.setReadTimeout(120 * 1000)
|
|
||||||
.execute();
|
|
||||||
if (res.getStatus() != 200) {
|
|
||||||
log.error("报表数据,网络请求错误!", res.body());
|
|
||||||
throw new GridReportException("报表数据,网络请求错误!");
|
|
||||||
}
|
|
||||||
String body = res.body();
|
|
||||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
|
||||||
if (dataR != null && dataR.getCode() == 0) {
|
|
||||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
|
||||||
reportData = JSON.toJSONString(dataR);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Map<String, Object> map = BeanUtil.beanToMap(dataR.getData());
|
|
||||||
for (Map.Entry<String,Object> obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) {
|
|
||||||
reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString());
|
|
||||||
}
|
|
||||||
reportData = JSON.toJSONString(dataR.getData());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.error("获取报表数据错误!", dataR.getMsg());
|
|
||||||
log.error("报表数据:" + reportData);
|
|
||||||
throw new GridReportException("获取报表数据错误!");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
|
||||||
MediaType mediaType = null;
|
|
||||||
byte[] docBytes = null;
|
|
||||||
//文件扩展名
|
|
||||||
String fileExtName = type.toLowerCase();
|
|
||||||
switch (type.toUpperCase()) {
|
|
||||||
case "PDF":
|
|
||||||
mediaType = MediaType.APPLICATION_PDF;
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "OFD":
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "RTF":
|
|
||||||
fileExtName = "doc";
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
case "IMG":
|
|
||||||
fileExtName = "png";
|
|
||||||
mediaType = MediaType.IMAGE_PNG;
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export")
|
|
||||||
@Operation(summary = "导出报表")
|
|
||||||
public ResponseEntity<ResourceRegion> export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
|
||||||
ConfigReportTemplateDO gridppReportFile = null;
|
|
||||||
if (reportId != null) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
|
||||||
} else if (StrUtil.isNotBlank(reportKey)) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
|
||||||
throw new GridReportException("未找到报表模板!");
|
|
||||||
}
|
|
||||||
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
|
||||||
|
|
||||||
//报表参数
|
|
||||||
Map<String, String> reportParams = new HashMap<>();
|
|
||||||
//获取当前用户姓名
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
String realName = "";
|
|
||||||
if (user != null) {
|
|
||||||
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
|
||||||
}
|
|
||||||
reportParams.put("operName", realName);
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(dataUrl)) {
|
|
||||||
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
|
||||||
//处理url参数
|
|
||||||
if (dataUrl.contains("?")) {
|
|
||||||
String urlParam = dataUrl.split("\\?")[1];
|
|
||||||
String[] urlVks = urlParam.split("&");
|
|
||||||
for (int i = 0; i < urlVks.length; i++) {
|
|
||||||
String vk = urlVks[i];
|
|
||||||
if (StrUtil.isNotBlank(vk)) {
|
|
||||||
String[] vkSplit = vk.split("=");
|
|
||||||
if(vkSplit.length == 2){
|
|
||||||
reportParams.put(vkSplit[0], vkSplit[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Map<String, String> headers = new HashMap<>();
|
|
||||||
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
|
||||||
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
|
||||||
headers.put(securityProperties.getTokenHeader(), token);
|
|
||||||
HttpResponse res = HttpRequest.get(dataUrl)
|
|
||||||
.addHeaders(headers)
|
|
||||||
.setConnectionTimeout(60 * 1000)
|
|
||||||
.setReadTimeout(120 * 1000)
|
|
||||||
.execute();
|
|
||||||
if (res.getStatus() != 200) {
|
|
||||||
log.error("报表数据,网络请求错误!", res.body());
|
|
||||||
throw new GridReportException("报表数据,网络请求错误!");
|
|
||||||
}
|
|
||||||
String body = res.body();
|
|
||||||
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
|
||||||
if (dataR != null && dataR.getCode() == 0) {
|
|
||||||
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
|
||||||
reportData = JSON.toJSONString(dataR);
|
|
||||||
} else {
|
|
||||||
reportData = JSON.toJSONString(dataR.getData());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
log.error("获取报表数据错误!", dataR.getMsg());
|
|
||||||
throw new GridReportException("获取报表数据错误!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
|
||||||
byte[] docBytes = null;
|
|
||||||
//文件扩展名
|
|
||||||
String fileExtName = type.toLowerCase();
|
|
||||||
switch (type.toUpperCase()) {
|
|
||||||
case "PDF":
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "OFD":
|
|
||||||
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
|
||||||
break;
|
|
||||||
case "RTF":
|
|
||||||
fileExtName = "doc";
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
case "IMG":
|
|
||||||
fileExtName = "png";
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
docBytes = binaryObject.getDataBuf();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
String fileName = gridppReportFile.getName();
|
|
||||||
if (StrUtil.isNotBlank(exportName)) {
|
|
||||||
fileName = exportName;
|
|
||||||
}
|
|
||||||
return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成Base64图片
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/gen-report-png-image-base64")
|
|
||||||
@Operation(summary = "生成Base64图片")
|
|
||||||
public CommonResult<?> genReportPngImageBase64(@RequestBody GenReportBody body) {
|
|
||||||
ConfigReportTemplateDO gridppReportFile = null;
|
|
||||||
if (body.getReportId() != null) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
|
||||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
|
||||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
String imgBase64 = null;
|
|
||||||
try {
|
|
||||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi());
|
|
||||||
imgBase64 = binaryObject.getAsBase64Text();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("生成base64图片失败", e);
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(imgBase64)) {
|
|
||||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
|
||||||
}
|
|
||||||
return success(imgBase64);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成Base64图片
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/gen-report-png-image-base64-by-pdf")
|
|
||||||
@Operation(summary = "生成Base64图片")
|
|
||||||
public CommonResult<?> genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) {
|
|
||||||
ConfigReportTemplateDO gridppReportFile = null;
|
|
||||||
if (body.getReportId() != null) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
|
||||||
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
|
||||||
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
|
||||||
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
String imgBase64 = null;
|
|
||||||
try {
|
|
||||||
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF);
|
|
||||||
byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi());
|
|
||||||
//String encodeHexStr = HexUtil.encodeHexStr(pngBytes);
|
|
||||||
//System.out.println(encodeHexStr);
|
|
||||||
imgBase64 = Base64.encode(pngBytes);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("生成base64图片失败", e);
|
|
||||||
}
|
|
||||||
if (StringUtils.isBlank(imgBase64)) {
|
|
||||||
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
|
||||||
}
|
|
||||||
return success(imgBase64);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载文件
|
|
||||||
*
|
|
||||||
* @param file 文件
|
|
||||||
* @return {ResponseEntity}
|
|
||||||
* @throws IOException io异常
|
|
||||||
*/
|
|
||||||
protected ResponseEntity<ResourceRegion> download(File file) throws IOException {
|
|
||||||
String fileName = file.getName();
|
|
||||||
return download(file, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载
|
|
||||||
*
|
|
||||||
* @param file 文件
|
|
||||||
* @param fileName 生成的文件名
|
|
||||||
* @return {ResponseEntity}
|
|
||||||
* @throws IOException io异常
|
|
||||||
*/
|
|
||||||
protected ResponseEntity<ResourceRegion> download(File file, String fileName) throws IOException {
|
|
||||||
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
|
||||||
return download(resource, fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下载
|
|
||||||
*
|
|
||||||
* @param resource 资源
|
|
||||||
* @param fileName 生成的文件名
|
|
||||||
* @return {ResponseEntity}
|
|
||||||
* @throws IOException io异常
|
|
||||||
*/
|
|
||||||
protected ResponseEntity<ResourceRegion> download(org.springframework.core.io.Resource resource, String fileName) throws IOException {
|
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
|
||||||
String header = request.getHeader(HttpHeaders.USER_AGENT);
|
|
||||||
// 避免空指针
|
|
||||||
header = header == null ? StringPool.EMPTY : header.toUpperCase();
|
|
||||||
HttpStatus status= HttpStatus.OK;
|
|
||||||
// 断点续传
|
|
||||||
long position = 0;
|
|
||||||
long count = resource.contentLength();
|
|
||||||
String range = request.getHeader(HttpHeaders.RANGE);
|
|
||||||
if (null != range) {
|
|
||||||
status = HttpStatus.PARTIAL_CONTENT;
|
|
||||||
String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH);
|
|
||||||
position = Long.parseLong(rangeRange[0]);
|
|
||||||
if (rangeRange.length > 1) {
|
|
||||||
long end = Long.parseLong(rangeRange[1]);
|
|
||||||
count = end - position + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
|
||||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
|
||||||
// 兼容各种浏览器下载:
|
|
||||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
|
||||||
String disposition = "attachment;" +
|
|
||||||
"filename=\"" + encodeFileName + "\";" +
|
|
||||||
"filename*=utf-8''" + encodeFileName;
|
|
||||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
|
||||||
return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 浏览器打开
|
|
||||||
*
|
|
||||||
* @param resource 资源
|
|
||||||
* @param fileName 生成的文件名
|
|
||||||
* @return {ResponseEntity}
|
|
||||||
* @throws IOException io异常
|
|
||||||
*/
|
|
||||||
protected ResponseEntity<org.springframework.core.io.Resource> browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException {
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.setContentType(mediaType);
|
|
||||||
headers.setContentLength(resource.contentLength());
|
|
||||||
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
|
||||||
// 兼容各种浏览器下载:
|
|
||||||
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
|
||||||
String disposition = "inline;" +
|
|
||||||
"filename=\"" + encodeFileName + "\";" +
|
|
||||||
"filename*=utf-8''" + encodeFileName;
|
|
||||||
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
|
||||||
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,556 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.admin;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.text.StringEscapeUtils;
|
||||||
|
import org.springframework.core.io.ByteArrayResource;
|
||||||
|
import org.springframework.core.io.FileSystemResource;
|
||||||
|
import org.springframework.core.io.support.ResourceRegion;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.util.UriUtils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
||||||
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.servlet.ServletUtils;
|
||||||
|
import com.zt.plat.framework.security.config.SecurityProperties;
|
||||||
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.framework.web.core.util.WebFrameworkUtils;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.GenReportBody;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTemplateDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.service.ConfigReportTemplateService;
|
||||||
|
import com.zt.plat.module.qms.enums.ErrorCodeConstants;
|
||||||
|
import com.zt.plat.module.qms.framework.gridreport.GridReport;
|
||||||
|
import com.zt.plat.module.qms.framework.gridreport.PdfHelper;
|
||||||
|
import com.zt.plat.module.qms.framework.gridreport.exception.GridReportException;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.codec.Base64;
|
||||||
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import gridreport.jni.BinaryObject;
|
||||||
|
import gridreport.jni.ExportImageType;
|
||||||
|
import gridreport.jni.ExportType;
|
||||||
|
import gridreport.jni.Report;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/config-report-template")
|
||||||
|
public class GridReportController {
|
||||||
|
|
||||||
|
public static final String WR_PREFIX = "_WR_";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GridReport gridReport;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SecurityProperties securityProperties;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigReportTemplateService configReportTemplateService;
|
||||||
|
|
||||||
|
@GetMapping("/info")
|
||||||
|
@Operation(summary = "获取报表信息")
|
||||||
|
public CommonResult<?> info() {
|
||||||
|
Map<String, Object> data = new HashMap<>();
|
||||||
|
try {
|
||||||
|
String moduleInfo = Report.getModuleInfo();
|
||||||
|
String moduleVersion = Report.getModuleVersion();
|
||||||
|
String modulePath = Report.getModulePath();
|
||||||
|
data.put("moduleInfo", moduleInfo);
|
||||||
|
data.put("moduleVersion", moduleVersion);
|
||||||
|
data.put("modulePath", modulePath);
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 预览报表
|
||||||
|
* @param reportId
|
||||||
|
* @param reportKey
|
||||||
|
* @param dataUrl
|
||||||
|
* @param isCrypto
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@GetMapping("/preview")
|
||||||
|
@Operation(summary = "预览报表")
|
||||||
|
public ResponseEntity<org.springframework.core.io.Resource> preview(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||||
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
|
ConfigReportTemplateDO gridppReportFile = null;
|
||||||
|
if (reportId != null) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||||
|
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||||
|
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||||
|
|
||||||
|
//报表参数
|
||||||
|
Map<String, String> reportParams = new HashMap<>();
|
||||||
|
//获取当前用户姓名
|
||||||
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
String realName = "";
|
||||||
|
if (user != null) {
|
||||||
|
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
}
|
||||||
|
reportParams.put("operName", realName);
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(dataUrl)) {
|
||||||
|
log.info("url:" + dataUrl);
|
||||||
|
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||||
|
log.info("url:" + dataUrl);
|
||||||
|
//处理url参数
|
||||||
|
if(dataUrl.contains("?")) {
|
||||||
|
String urlParam = dataUrl.split("\\?")[1];
|
||||||
|
String[] urlVks = urlParam.split("&");
|
||||||
|
for (int i = 0; i < urlVks.length; i++) {
|
||||||
|
String vk = urlVks[i];
|
||||||
|
if (StrUtil.isNotBlank(vk)) {
|
||||||
|
String[] vkSplit = vk.split("=");
|
||||||
|
if(vkSplit.length == 2){
|
||||||
|
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||||
|
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||||
|
headers.put(securityProperties.getTokenHeader(), token);
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||||
|
|
||||||
|
HttpResponse res = HttpRequest.get(dataUrl)
|
||||||
|
.addHeaders(headers)
|
||||||
|
.setConnectionTimeout(60 * 1000)
|
||||||
|
.setReadTimeout(120 * 1000)
|
||||||
|
.execute();
|
||||||
|
if (res.getStatus() != 200) {
|
||||||
|
log.error("报表数据,网络请求错误!", res.body());
|
||||||
|
throw new GridReportException("报表数据,网络请求错误!");
|
||||||
|
}
|
||||||
|
String body = res.body();
|
||||||
|
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||||
|
if (dataR != null && dataR.getCode() == 0) {
|
||||||
|
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||||
|
reportData = JSON.toJSONString(dataR);
|
||||||
|
} else {
|
||||||
|
reportData = JSON.toJSONString(dataR.getData());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("获取报表数据错误!", dataR.getMsg());
|
||||||
|
log.error("报表数据:" + reportData);
|
||||||
|
throw new GridReportException("获取报表数据错误!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||||
|
MediaType mediaType = null;
|
||||||
|
byte[] docBytes = null;
|
||||||
|
//文件扩展名
|
||||||
|
String fileExtName = type.toLowerCase();
|
||||||
|
switch (type.toUpperCase()) {
|
||||||
|
case "PDF":
|
||||||
|
mediaType = MediaType.APPLICATION_PDF;
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "OFD":
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "RTF":
|
||||||
|
fileExtName = "doc";
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/previewDocs")
|
||||||
|
@Operation(summary = "报告预览报表")
|
||||||
|
public ResponseEntity<org.springframework.core.io.Resource> previewDocs(Long reportId, String reportKey, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||||
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
|
ConfigReportTemplateDO gridppReportFile = null;
|
||||||
|
if (reportId != null) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||||
|
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||||
|
throw new GridReportException("未找到报表模板!");
|
||||||
|
}
|
||||||
|
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||||
|
|
||||||
|
//报表参数
|
||||||
|
Map<String, String> reportParams = new HashMap<>();
|
||||||
|
//获取当前用户姓名
|
||||||
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
String realName = "";
|
||||||
|
if (user != null) {
|
||||||
|
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
}
|
||||||
|
reportParams.put("operName", realName);
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(dataUrl)) {
|
||||||
|
log.info("url:" + dataUrl);
|
||||||
|
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||||
|
log.info("url:" + dataUrl);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||||
|
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||||
|
headers.put(securityProperties.getTokenHeader(), token);
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||||
|
HttpResponse res = HttpRequest.get(dataUrl)
|
||||||
|
.addHeaders(headers)
|
||||||
|
.setConnectionTimeout(60 * 1000)
|
||||||
|
.setReadTimeout(120 * 1000)
|
||||||
|
.execute();
|
||||||
|
if (res.getStatus() != 200) {
|
||||||
|
log.error("报表数据,网络请求错误!", res.body());
|
||||||
|
throw new GridReportException("报表数据,网络请求错误!");
|
||||||
|
}
|
||||||
|
String body = res.body();
|
||||||
|
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||||
|
if (dataR != null && dataR.getCode() == 0) {
|
||||||
|
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||||
|
reportData = JSON.toJSONString(dataR);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Map<String, Object> map = BeanUtil.beanToMap(dataR.getData());
|
||||||
|
for (Map.Entry<String,Object> obj : BeanUtil.beanToMap(map.get("reportParams")).entrySet()) {
|
||||||
|
reportParams.put(obj.getKey(), obj.getValue() == null ? "": obj.getValue().toString());
|
||||||
|
}
|
||||||
|
reportData = JSON.toJSONString(dataR.getData());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("获取报表数据错误!", dataR.getMsg());
|
||||||
|
log.error("报表数据:" + reportData);
|
||||||
|
throw new GridReportException("获取报表数据错误!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||||
|
MediaType mediaType = null;
|
||||||
|
byte[] docBytes = null;
|
||||||
|
//文件扩展名
|
||||||
|
String fileExtName = type.toLowerCase();
|
||||||
|
switch (type.toUpperCase()) {
|
||||||
|
case "PDF":
|
||||||
|
mediaType = MediaType.APPLICATION_PDF;
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "OFD":
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "RTF":
|
||||||
|
fileExtName = "doc";
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
case "IMG":
|
||||||
|
fileExtName = "png";
|
||||||
|
mediaType = MediaType.IMAGE_PNG;
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
mediaType = MediaType.APPLICATION_OCTET_STREAM;
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return browser(new ByteArrayResource(docBytes), gridppReportFile.getName() + "." + fileExtName, mediaType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export")
|
||||||
|
@Operation(summary = "导出报表")
|
||||||
|
public ResponseEntity<ResourceRegion> export(Long reportId, String reportKey, String exportName, String dataUrl, Boolean isCrypto, String type) throws Exception {
|
||||||
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
|
ConfigReportTemplateDO gridppReportFile = null;
|
||||||
|
if (reportId != null) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplate(reportId);
|
||||||
|
} else if (StrUtil.isNotBlank(reportKey)) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(reportKey);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||||
|
throw new GridReportException("未找到报表模板!");
|
||||||
|
}
|
||||||
|
String reportData = StringEscapeUtils.unescapeHtml4(gridppReportFile.getData());
|
||||||
|
|
||||||
|
//报表参数
|
||||||
|
Map<String, String> reportParams = new HashMap<>();
|
||||||
|
//获取当前用户姓名
|
||||||
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
String realName = "";
|
||||||
|
if (user != null) {
|
||||||
|
realName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
}
|
||||||
|
reportParams.put("operName", realName);
|
||||||
|
|
||||||
|
if (StrUtil.isNotBlank(dataUrl)) {
|
||||||
|
dataUrl = StringEscapeUtils.unescapeHtml4(dataUrl);
|
||||||
|
//处理url参数
|
||||||
|
if (dataUrl.contains("?")) {
|
||||||
|
String urlParam = dataUrl.split("\\?")[1];
|
||||||
|
String[] urlVks = urlParam.split("&");
|
||||||
|
for (int i = 0; i < urlVks.length; i++) {
|
||||||
|
String vk = urlVks[i];
|
||||||
|
if (StrUtil.isNotBlank(vk)) {
|
||||||
|
String[] vkSplit = vk.split("=");
|
||||||
|
if(vkSplit.length == 2){
|
||||||
|
reportParams.put(vkSplit[0], vkSplit[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
String token = SecurityFrameworkUtils.obtainAuthorization(request,
|
||||||
|
securityProperties.getTokenHeader(), securityProperties.getTokenParameter());
|
||||||
|
headers.put(securityProperties.getTokenHeader(), token);
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_COMPANY_ID, user.getVisitCompanyId() + "");
|
||||||
|
// headers.put(WebFrameworkUtils.HEADER_VISIT_DEPT_ID, user.getVisitDeptId() + "");
|
||||||
|
HttpResponse res = HttpRequest.get(dataUrl)
|
||||||
|
.addHeaders(headers)
|
||||||
|
.setConnectionTimeout(60 * 1000)
|
||||||
|
.setReadTimeout(120 * 1000)
|
||||||
|
.execute();
|
||||||
|
if (res.getStatus() != 200) {
|
||||||
|
log.error("报表数据,网络请求错误!", res.body());
|
||||||
|
throw new GridReportException("报表数据,网络请求错误!");
|
||||||
|
}
|
||||||
|
String body = res.body();
|
||||||
|
CommonResult<?> dataR = JSON.parseObject(body, CommonResult.class);
|
||||||
|
if (dataR != null && dataR.getCode() == 0) {
|
||||||
|
if (ArrayUtil.isArray(dataR.getData()) || dataR.getData() instanceof Collection) {
|
||||||
|
reportData = JSON.toJSONString(dataR);
|
||||||
|
} else {
|
||||||
|
reportData = JSON.toJSONString(dataR.getData());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.error("获取报表数据错误!", dataR.getMsg());
|
||||||
|
throw new GridReportException("获取报表数据错误!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), reportData, reportParams, ExportType.valueOf("OFD".equals(type.toUpperCase()) ? "PDF" : type.toUpperCase()));
|
||||||
|
byte[] docBytes = null;
|
||||||
|
//文件扩展名
|
||||||
|
String fileExtName = type.toLowerCase();
|
||||||
|
switch (type.toUpperCase()) {
|
||||||
|
case "PDF":
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "OFD":
|
||||||
|
docBytes = PdfHelper.modifyDocInfo(binaryObject.getDataBuf());
|
||||||
|
break;
|
||||||
|
case "RTF":
|
||||||
|
fileExtName = "doc";
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
case "IMG":
|
||||||
|
fileExtName = "png";
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
docBytes = binaryObject.getDataBuf();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
String fileName = gridppReportFile.getName();
|
||||||
|
if (StrUtil.isNotBlank(exportName)) {
|
||||||
|
fileName = exportName;
|
||||||
|
}
|
||||||
|
return download(new ByteArrayResource(docBytes), fileName + "." + fileExtName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成Base64图片
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/gen-report-png-image-base64")
|
||||||
|
@Operation(summary = "生成Base64图片")
|
||||||
|
public CommonResult<?> genReportPngImageBase64(@RequestBody GenReportBody body) {
|
||||||
|
ConfigReportTemplateDO gridppReportFile = null;
|
||||||
|
if (body.getReportId() != null) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||||
|
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||||
|
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
String imgBase64 = null;
|
||||||
|
try {
|
||||||
|
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.IMG, ExportImageType.PNG, body.getImgDpi());
|
||||||
|
imgBase64 = binaryObject.getAsBase64Text();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("生成base64图片失败", e);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(imgBase64)) {
|
||||||
|
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||||
|
}
|
||||||
|
return success(imgBase64);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成Base64图片
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/gen-report-png-image-base64-by-pdf")
|
||||||
|
@Operation(summary = "生成Base64图片")
|
||||||
|
public CommonResult<?> genReportPngImageBase64ByPdf(@RequestBody GenReportBody body) {
|
||||||
|
ConfigReportTemplateDO gridppReportFile = null;
|
||||||
|
if (body.getReportId() != null) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplate(body.getReportId());
|
||||||
|
} else if (StrUtil.isNotBlank(body.getReportKey())) {
|
||||||
|
gridppReportFile = configReportTemplateService.getConfigReportTemplateByKey(body.getReportKey());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isEmpty(gridppReportFile)) {
|
||||||
|
throw new ServiceException(ErrorCodeConstants.CONFIG_REPORT_TEMPLATE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
String imgBase64 = null;
|
||||||
|
try {
|
||||||
|
BinaryObject binaryObject = gridReport.genReport(gridppReportFile.getContent(), body.getReportDataJson(), body.getReportParams(), ExportType.PDF);
|
||||||
|
byte[] pngBytes = PdfHelper.pdfToPng(binaryObject.getDataBuf(), body.getImgDpi());
|
||||||
|
//String encodeHexStr = HexUtil.encodeHexStr(pngBytes);
|
||||||
|
//System.out.println(encodeHexStr);
|
||||||
|
imgBase64 = Base64.encode(pngBytes);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("生成base64图片失败", e);
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(imgBase64)) {
|
||||||
|
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||||
|
}
|
||||||
|
return success(imgBase64);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载文件
|
||||||
|
*
|
||||||
|
* @param file 文件
|
||||||
|
* @return {ResponseEntity}
|
||||||
|
* @throws IOException io异常
|
||||||
|
*/
|
||||||
|
protected ResponseEntity<ResourceRegion> download(File file) throws IOException {
|
||||||
|
String fileName = file.getName();
|
||||||
|
return download(file, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载
|
||||||
|
*
|
||||||
|
* @param file 文件
|
||||||
|
* @param fileName 生成的文件名
|
||||||
|
* @return {ResponseEntity}
|
||||||
|
* @throws IOException io异常
|
||||||
|
*/
|
||||||
|
protected ResponseEntity<ResourceRegion> download(File file, String fileName) throws IOException {
|
||||||
|
org.springframework.core.io.Resource resource = new FileSystemResource(file);
|
||||||
|
return download(resource, fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载
|
||||||
|
*
|
||||||
|
* @param resource 资源
|
||||||
|
* @param fileName 生成的文件名
|
||||||
|
* @return {ResponseEntity}
|
||||||
|
* @throws IOException io异常
|
||||||
|
*/
|
||||||
|
protected ResponseEntity<ResourceRegion> download(org.springframework.core.io.Resource resource, String fileName) throws IOException {
|
||||||
|
HttpServletRequest request = ServletUtils.getRequest();
|
||||||
|
String header = request.getHeader(HttpHeaders.USER_AGENT);
|
||||||
|
// 避免空指针
|
||||||
|
header = header == null ? StringPool.EMPTY : header.toUpperCase();
|
||||||
|
HttpStatus status= HttpStatus.OK;
|
||||||
|
// 断点续传
|
||||||
|
long position = 0;
|
||||||
|
long count = resource.contentLength();
|
||||||
|
String range = request.getHeader(HttpHeaders.RANGE);
|
||||||
|
if (null != range) {
|
||||||
|
status = HttpStatus.PARTIAL_CONTENT;
|
||||||
|
String[] rangeRange = range.replace("bytes=", StringPool.EMPTY).split(StringPool.DASH);
|
||||||
|
position = Long.parseLong(rangeRange[0]);
|
||||||
|
if (rangeRange.length > 1) {
|
||||||
|
long end = Long.parseLong(rangeRange[1]);
|
||||||
|
count = end - position + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
|
||||||
|
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||||
|
// 兼容各种浏览器下载:
|
||||||
|
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||||
|
String disposition = "attachment;" +
|
||||||
|
"filename=\"" + encodeFileName + "\";" +
|
||||||
|
"filename*=utf-8''" + encodeFileName;
|
||||||
|
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||||
|
return new ResponseEntity<>(new ResourceRegion(resource, position, count), headers, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 浏览器打开
|
||||||
|
*
|
||||||
|
* @param resource 资源
|
||||||
|
* @param fileName 生成的文件名
|
||||||
|
* @return {ResponseEntity}
|
||||||
|
* @throws IOException io异常
|
||||||
|
*/
|
||||||
|
protected ResponseEntity<org.springframework.core.io.Resource> browser(org.springframework.core.io.Resource resource, String fileName, MediaType mediaType) throws IOException {
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.setContentType(mediaType);
|
||||||
|
headers.setContentLength(resource.contentLength());
|
||||||
|
String encodeFileName = UriUtils.encode(fileName, StandardCharsets.UTF_8);
|
||||||
|
// 兼容各种浏览器下载:
|
||||||
|
// https://blog.robotshell.org/2012/deal-with-http-header-encoding-for-file-download/
|
||||||
|
String disposition = "inline;" +
|
||||||
|
"filename=\"" + encodeFileName + "\";" +
|
||||||
|
"filename*=utf-8''" + encodeFileName;
|
||||||
|
headers.set(HttpHeaders.CONTENT_DISPOSITION, disposition);
|
||||||
|
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -70,6 +70,10 @@ public class MaterialAssayStandardController implements BusinessControllerMarker
|
|||||||
@Operation(summary = "更新检测标准")
|
@Operation(summary = "更新检测标准")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')")
|
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')")
|
||||||
public CommonResult<Boolean> updateMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO updateReqVO) {
|
||||||
|
Long id = updateReqVO.getId();
|
||||||
|
MaterialAssayStandardDO entity = materialAssayStandardService.getMaterialAssayStandard(id);
|
||||||
|
if("tempDataKey".equals(entity.getRemark()))
|
||||||
|
updateReqVO.setRemark("");
|
||||||
materialAssayStandardService.updateMaterialAssayStandard(updateReqVO);
|
materialAssayStandardService.updateMaterialAssayStandard(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,14 @@ public class MaterialAssayStandardDetailController implements BusinessController
|
|||||||
return success(jsonArray);
|
return success(jsonArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getByStandardId")
|
||||||
|
@Operation(summary = "获得物料检测标准检测项目分页")
|
||||||
|
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')")
|
||||||
|
public CommonResult<List<MaterialAssayStandardDetailRespVO>> getByStandardId(@Valid MaterialAssayStandardDetailPageReqVO pageReqVO) {
|
||||||
|
List<MaterialAssayStandardDetailRespVO> list = materialAssayStandardDetailService.getByStandardId(pageReqVO.getMaterialAssayStandardId());
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建物料检测标准检测项目")
|
@Operation(summary = "创建物料检测标准检测项目")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')")
|
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')")
|
||||||
|
|||||||
@@ -42,4 +42,9 @@ public class BaseSamplePageReqVO extends PageParam {
|
|||||||
@Schema(description = "检测标准数量")
|
@Schema(description = "检测标准数量")
|
||||||
private String assayStandardCount;
|
private String assayStandardCount;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1")
|
||||||
|
private String entrustType;
|
||||||
}
|
}
|
||||||
@@ -24,6 +24,9 @@ public class ConfigAssayMethodPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "方法名称", example = "李四")
|
@Schema(description = "方法名称", example = "李四")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "方法名称及类别")
|
||||||
|
private String methodNameCategory;
|
||||||
|
|
||||||
@Schema(description = "方法编号")
|
@Schema(description = "方法编号")
|
||||||
private String methodCode;
|
private String methodCode;
|
||||||
|
|||||||
@@ -19,6 +19,27 @@ public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam {
|
|||||||
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "1283")
|
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "1283")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,27 @@ public class ConfigAssayMethodProjectParameterRespVO {
|
|||||||
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|||||||
@@ -20,6 +20,27 @@ public class ConfigAssayMethodProjectParameterSaveReqVO {
|
|||||||
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|||||||
@@ -25,6 +25,9 @@ public class ConfigAssayMethodReqVO {
|
|||||||
@Schema(description = "方法名称", example = "李四")
|
@Schema(description = "方法名称", example = "李四")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "方法名称及类别")
|
||||||
|
private String methodNameCategory;
|
||||||
|
|
||||||
@Schema(description = "方法编号")
|
@Schema(description = "方法编号")
|
||||||
private String methodCode;
|
private String methodCode;
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ public class ConfigAssayMethodRespVO {
|
|||||||
@ExcelProperty("方法名称")
|
@ExcelProperty("方法名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "方法名称及类别")
|
||||||
|
private String methodNameCategory;
|
||||||
|
|
||||||
@Schema(description = "方法编号")
|
@Schema(description = "方法编号")
|
||||||
@ExcelProperty("方法编号")
|
@ExcelProperty("方法编号")
|
||||||
private String methodCode;
|
private String methodCode;
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class ConfigAssayMethodSaveReqVO {
|
|||||||
@Schema(description = "方法名称", example = "李四")
|
@Schema(description = "方法名称", example = "李四")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "方法名称及类别")
|
||||||
|
private String methodNameCategory;
|
||||||
|
|
||||||
@Schema(description = "方法编号")
|
@Schema(description = "方法编号")
|
||||||
private String methodCode;
|
private String methodCode;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 检验委托来源与样品类型配置分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ConfigEntrustSourceSampleTypePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", example = "30057")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 检验委托来源与样品类型配置 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ConfigEntrustSourceSampleTypeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||||
|
@ExcelProperty("检验委托来源配置ID")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||||
|
@ExcelProperty("样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
@ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 检验委托来源与样品类型配置新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ConfigEntrustSourceSampleTypeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||||
|
@NotEmpty(message = "检验委托来源配置ID不能为空")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||||
|
@NotNull(message = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品不能为空")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,23 +1,8 @@
|
|||||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ConfigQCSampleMethodParameterExtendRespVO extends ConfigQCSampleMethodParameterRespVO {
|
public class ConfigQCSampleMethodParameterExtendRespVO extends ConfigQCSampleMethodParameterRespVO {
|
||||||
|
|
||||||
@Schema(description = "参数序号")
|
|
||||||
private Integer dictionaryParameterNo;
|
|
||||||
|
|
||||||
@Schema(description = "名称", example = "王五")
|
|
||||||
private String dictionaryParameterName;
|
|
||||||
|
|
||||||
@Schema(description = "键值")
|
|
||||||
private String dictionaryParameterKey;
|
|
||||||
|
|
||||||
@Schema(description = "检测单位ID,UNT表", example = "20894")
|
|
||||||
private Long dictionaryParameterUnitId;
|
|
||||||
|
|
||||||
@Schema(description = "单位")
|
|
||||||
private String dictionaryParameterUnit;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,27 @@ public class ConfigQCSampleMethodParameterPageReqVO extends PageParam {
|
|||||||
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "29135")
|
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "29135")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算")
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,27 @@ public class ConfigQCSampleMethodParameterRespVO {
|
|||||||
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|||||||
@@ -20,6 +20,27 @@ public class ConfigQCSampleMethodParameterSaveReqVO {
|
|||||||
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称", example = "李四")
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
@Schema(description = "参数简称", example = "李四")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "参数序号")
|
||||||
|
private Integer no;
|
||||||
|
|
||||||
|
@Schema(description = "键值")
|
||||||
|
private String key;
|
||||||
|
|
||||||
|
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||||
|
private Long unitId;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private String fillingWay;
|
||||||
|
|
||||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ConfigSubSampleMethodConfAdd {
|
||||||
|
|
||||||
|
/** 分析方法id **/
|
||||||
|
private Long methodId;
|
||||||
|
|
||||||
|
/** 检测项目 **/
|
||||||
|
private List<Long> projectIdList;
|
||||||
|
|
||||||
|
/** 条件 需要存在分析的检测项目,才添加分析方法 **/
|
||||||
|
private List<Long> conditionProjectIdList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,9 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ConfigSubSampleMethodConfInfo {
|
public class ConfigSubSampleMethodConfInfo {
|
||||||
|
|
||||||
|
/** 添加分析任务 **/
|
||||||
|
private ConfigSubSampleMethodConfAdd addAssayTask;
|
||||||
|
|
||||||
/** 分析方法参数取值配置 **/
|
/** 分析方法参数取值配置 **/
|
||||||
private List<ConfigSubSampleMethodConfItem> getParam;
|
private List<ConfigSubSampleMethodConfItem> getParam;
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodResp
|
|||||||
@Schema(description = "分析方法名称")
|
@Schema(description = "分析方法名称")
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
/** 分析方法编号 **/
|
/** 分析方法编号 **/
|
||||||
@Schema(description = "分析方法编号")
|
@Schema(description = "分析方法编号")
|
||||||
private String configAssayMethodCode;
|
private String configAssayMethodCode;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
@@ -17,6 +18,7 @@ public class ConfigWarehouseLocationRespVO {
|
|||||||
@ExcelProperty("ID")
|
@ExcelProperty("ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
// @Dict(dictTable="t_cfg_wrh_loc",dicCode="id",dicText="name")
|
||||||
@Schema(description = "父ID", example = "31498")
|
@Schema(description = "父ID", example = "31498")
|
||||||
@ExcelProperty("父ID")
|
@ExcelProperty("父ID")
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|||||||
@@ -52,10 +52,15 @@ public class BaseSampleDO extends BusinessBaseDO {
|
|||||||
@TableField("MTRL_NAME")
|
@TableField("MTRL_NAME")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
/**
|
/**
|
||||||
* 样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样
|
* 样品类型
|
||||||
*/
|
*/
|
||||||
@TableField("DIC_BSN_ID")
|
@TableField("DIC_BSN_ID")
|
||||||
private Long dictionaryBusinessId;
|
private Long dictionaryBusinessId;
|
||||||
|
/**
|
||||||
|
* 样品类型key
|
||||||
|
*/
|
||||||
|
@TableField("DIC_BSN_KY")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
/**
|
/**
|
||||||
* 所属部门
|
* 所属部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class ConfigAssayMethodDO extends BusinessBaseDO {
|
|||||||
@TableField("MTHD_CD")
|
@TableField("MTHD_CD")
|
||||||
private String methodCode;
|
private String methodCode;
|
||||||
/**
|
/**
|
||||||
|
* 方法名称及类别
|
||||||
|
*/
|
||||||
|
@TableField("MTHD_NAME_CTGR")
|
||||||
|
private String methodNameCategory;
|
||||||
|
/**
|
||||||
* 描述
|
* 描述
|
||||||
*/
|
*/
|
||||||
@TableField("DSP")
|
@TableField("DSP")
|
||||||
|
|||||||
@@ -42,6 +42,41 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO {
|
|||||||
@TableField("DIC_PRM_ID")
|
@TableField("DIC_PRM_ID")
|
||||||
private Long dictionaryParameterId;
|
private Long dictionaryParameterId;
|
||||||
/**
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
@TableField("PRM_NAME")
|
||||||
|
private String parameterName;
|
||||||
|
/**
|
||||||
|
* 参数简称
|
||||||
|
*/
|
||||||
|
@TableField("SHRT_NAME")
|
||||||
|
private String shortName;
|
||||||
|
/**
|
||||||
|
* 参数序号
|
||||||
|
*/
|
||||||
|
@TableField("NO")
|
||||||
|
private Integer no;
|
||||||
|
/**
|
||||||
|
* 键值
|
||||||
|
*/
|
||||||
|
@TableField("KY")
|
||||||
|
private String key;
|
||||||
|
/**
|
||||||
|
* 单位ID,UNT表
|
||||||
|
*/
|
||||||
|
@TableField("UNT_ID")
|
||||||
|
private Long unitId;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@TableField("UNT")
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算
|
||||||
|
*/
|
||||||
|
@TableField("FIL_WY")
|
||||||
|
private String fillingWay;
|
||||||
|
/**
|
||||||
* 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间
|
* 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间
|
||||||
*/
|
*/
|
||||||
@TableField("DAT_TP")
|
@TableField("DAT_TP")
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user