Compare commits
31 Commits
9ec70c1721
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 8309ac0f4e | |||
| 45ba58cadb | |||
| eb757e8271 | |||
|
|
11bb57b1a4 | ||
|
|
a536f5c841 | ||
| 607dc05409 | |||
| 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 |
1191
doc/中铜技术文档/iWork集成说明.md
Normal file
1191
doc/中铜技术文档/iWork集成说明.md
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONFIG_SUB_SAMPLE_PARENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样配置不存在");
|
ErrorCode CONFIG_SUB_SAMPLE_PARENT_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样配置不存在");
|
||||||
ErrorCode CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与检测方法配置不存在");
|
ErrorCode CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与检测方法配置不存在");
|
||||||
//ErrorCode CONFIG_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与复检配置不存在");
|
//ErrorCode CONFIG_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS = new ErrorCode(1_032_050_000, "分样与复检配置不存在");
|
||||||
ErrorCode CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样与检测方法配置不存在");
|
ErrorCode CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样与分样检测方法配置表不存在");
|
||||||
ErrorCode CONFIG_SUB_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样配置不存在");
|
ErrorCode CONFIG_SUB_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "子样配置不存在");
|
||||||
ErrorCode CONFIG_SAMPLE_REPORT_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品报表关系不存在");
|
ErrorCode CONFIG_SAMPLE_REPORT_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品报表关系不存在");
|
||||||
ErrorCode CONFIG_SAMPLE_FLOW_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品流程配置不存在");
|
ErrorCode CONFIG_SAMPLE_FLOW_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品流程配置不存在");
|
||||||
@@ -140,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, "样品调拨明细不存在");
|
||||||
@@ -159,6 +160,18 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_INVENTORY_INBOUND_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 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 ==================================*/
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ public class QmsBpmConstant {
|
|||||||
public static final String BPM_FIELD_EXTENSIONS = "bpmFieldExtensions";
|
public static final String BPM_FIELD_EXTENSIONS = "bpmFieldExtensions";
|
||||||
public static final String BPM_FIRST_ACTIVITY_FLAG = "firstActivityFlag";
|
public static final String BPM_FIRST_ACTIVITY_FLAG = "firstActivityFlag";
|
||||||
public static final String BPM_LAST_ACTIVITY_FLAG = "lastActivityFlag";
|
public static final String BPM_LAST_ACTIVITY_FLAG = "lastActivityFlag";
|
||||||
|
public static final String BPM_REJECT_TO_FIRST_FLAG = "rejectToFirstActivity";
|
||||||
|
public static final String BPM_CUR_ACTIVITY_INS_ID = "currentActivityInsId"; //当前活动实例id
|
||||||
|
public static final String BPM_PROCESS_INS_ID = "processInstanceId"; //当前活动实例id
|
||||||
|
|
||||||
//驳回标记前缀
|
//驳回标记前缀
|
||||||
public static final String BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY = "RETURN_FLAG_";
|
public static final String BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY = "RETURN_FLAG_";
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
</description>
|
</description>
|
||||||
<properties>
|
<properties>
|
||||||
<zzjc.tio.version>3.9.1.v20251204-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 -->
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
|
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
@@ -20,6 +21,8 @@ import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethod
|
|||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
||||||
import com.zt.plat.module.qms.business.bus.service.SampleTaskAssignService;
|
import com.zt.plat.module.qms.business.bus.service.SampleTaskAssignService;
|
||||||
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -53,11 +56,20 @@ public class SampleTaskAssignController implements BusinessControllerMarker {
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
@GetMapping("/getAssayMethodList")
|
@GetMapping("/getAssayMethodList")
|
||||||
public CommonResult<?> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
public CommonResult<?> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
List<Object> list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId);
|
List<Object> list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
|
@GetMapping("/getAssayMethodProjectList")
|
||||||
|
public CommonResult<?> getAssayMethodProjectList(String businessSubSampleIds, Long configAssayMethodId) {
|
||||||
|
List<Long> businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList();
|
||||||
|
List<AssayMethodProjectRespVO> list = sampleTaskAssignService.getAssayMethodProjectList(businessSubSampleIdList, configAssayMethodId);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/changeMethod")
|
@PostMapping("/changeMethod")
|
||||||
public CommonResult<?> changeMethod(@RequestBody ChangeAssayMethodReqVO req) {
|
public CommonResult<?> changeMethod(@RequestBody ChangeAssayMethodReqVO req) {
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AssayMethodProjectRespVO {
|
||||||
|
|
||||||
|
private Long dictionaryProjectId;
|
||||||
|
|
||||||
|
private String dictionaryProjectName;
|
||||||
|
|
||||||
|
private String dictionaryProjectSimpleName;
|
||||||
|
|
||||||
|
private String dictionaryProjectShowName;
|
||||||
|
|
||||||
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
|
private List<ConfigAssayMethodProjectExtendRespVO> methodList;
|
||||||
|
}
|
||||||
@@ -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,10 +5,15 @@ 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;
|
||||||
|
|
||||||
private Integer sampleTaskCount;
|
private Integer sampleTaskCount;
|
||||||
|
|||||||
@@ -108,6 +108,9 @@ public class BusinessAssayTaskDataReqVO {
|
|||||||
@Schema(description = "检测方法配置名称")
|
@Schema(description = "检测方法配置名称")
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "收样时间")
|
@Schema(description = "收样时间")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] sampleReceiveTime;
|
private LocalDateTime[] sampleReceiveTime;
|
||||||
@@ -115,6 +118,9 @@ public class BusinessAssayTaskDataReqVO {
|
|||||||
@Schema(description = "样品编号")
|
@Schema(description = "样品编号")
|
||||||
private String sampleCode;
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "样品名称")
|
||||||
|
private String sampleName;
|
||||||
|
|
||||||
@Schema(description = "分析编号")
|
@Schema(description = "分析编号")
|
||||||
private String sampleAssayCode;
|
private String sampleAssayCode;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class BusinessSubParentSampleAssessmentExtendRespVO extends BusinessSubParentSampleAssessmentRespVO {
|
public class BusinessSubParentSampleAssessmentExtendRespVO extends BusinessSubParentSampleAssessmentRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主样id")
|
||||||
|
private Long businessBaseSampleId;
|
||||||
|
|
||||||
|
@Schema(description = "分样配置id")
|
||||||
|
private Long configSubSampleParentId;
|
||||||
|
|
||||||
@Schema(description = "检测项目key")
|
@Schema(description = "检测项目key")
|
||||||
private String dictionaryProjectKey;
|
private String dictionaryProjectKey;
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ 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;
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,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;
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,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;
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ public class BusinessXRFDataPageReqVO extends PageParam {
|
|||||||
@Schema(description = "检测任务ID", example = "16505")
|
@Schema(description = "检测任务ID", example = "16505")
|
||||||
private Long businessAssayTaskDataId;
|
private Long businessAssayTaskDataId;
|
||||||
|
|
||||||
|
@Schema(description = "检测任务ID", example = "940")
|
||||||
|
private Long businessQCManagementDataId;
|
||||||
|
|
||||||
@Schema(description = "检测数据")
|
@Schema(description = "检测数据")
|
||||||
private String assayData;
|
private String assayData;
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ public class BusinessXRFDataReqVO {
|
|||||||
@Schema(description = "检测任务ID", example = "16505")
|
@Schema(description = "检测任务ID", example = "16505")
|
||||||
private Long businessAssayTaskDataId;
|
private Long businessAssayTaskDataId;
|
||||||
|
|
||||||
|
@Schema(description = "检测任务ID", example = "940")
|
||||||
|
private Long businessQCManagementDataId;
|
||||||
|
|
||||||
@Schema(description = "检测数据")
|
@Schema(description = "检测数据")
|
||||||
private String assayData;
|
private String assayData;
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ public class BusinessXRFDataRespVO {
|
|||||||
@Schema(description = "检测任务ID", example = "16505")
|
@Schema(description = "检测任务ID", example = "16505")
|
||||||
private Long businessAssayTaskDataId;
|
private Long businessAssayTaskDataId;
|
||||||
|
|
||||||
|
@Schema(description = "检测任务ID", example = "940")
|
||||||
|
private Long businessQCManagementDataId;
|
||||||
|
|
||||||
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("检测数据")
|
@ExcelProperty("检测数据")
|
||||||
private String assayData;
|
private String assayData;
|
||||||
|
|||||||
@@ -52,6 +52,9 @@ public class BusinessXRFDataSaveReqVO {
|
|||||||
@Schema(description = "检测任务ID", example = "16505")
|
@Schema(description = "检测任务ID", example = "16505")
|
||||||
private Long businessAssayTaskDataId;
|
private Long businessAssayTaskDataId;
|
||||||
|
|
||||||
|
@Schema(description = "检测任务ID", example = "940")
|
||||||
|
private Long businessQCManagementDataId;
|
||||||
|
|
||||||
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "检测数据不能为空")
|
@NotEmpty(message = "检测数据不能为空")
|
||||||
private String assayData;
|
private String assayData;
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ChangeAssayMethodReqVO {
|
public class ChangeAssayMethodReqVO {
|
||||||
|
|
||||||
private Long businessSubSampleId;
|
private List<Long> businessSubSampleIdList;
|
||||||
|
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
private List<Long> changeConfigAssayMethodIdList;
|
private List<AssayMethodProjectRespVO> changeConfigAssayMethodProjectList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -21,6 +22,9 @@ public class RecheckSubSampleParentMethodRespVO {
|
|||||||
|
|
||||||
private String configAssayMethodName;
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
private Long baseSampleId;
|
private Long baseSampleId;
|
||||||
|
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ public class UnAssignTaskedSubSampleRespVO implements Serializable {
|
|||||||
@Schema(description = "检测方法配置ID", example = "9130")
|
@Schema(description = "检测方法配置ID", example = "9130")
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "分析方法名称")
|
||||||
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2")
|
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "2")
|
||||||
private String assayType;
|
private String assayType;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -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")
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ public class BusinessXRFDataDO extends BusinessBaseDO {
|
|||||||
@TableField("BSN_ASY_TSK_DAT_ID")
|
@TableField("BSN_ASY_TSK_DAT_ID")
|
||||||
private Long businessAssayTaskDataId;
|
private Long businessAssayTaskDataId;
|
||||||
/**
|
/**
|
||||||
|
* 检测任务ID
|
||||||
|
*/
|
||||||
|
@TableField("BSN_QC_MNGT_DAT_ID")
|
||||||
|
private Long businessQCManagementDataId;
|
||||||
|
/**
|
||||||
* 检测数据
|
* 检测数据
|
||||||
*/
|
*/
|
||||||
@TableField("ASY_DAT")
|
@TableField("ASY_DAT")
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ 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.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.controller.vo.BusinessAssayProjectAndParameterRespVO;
|
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataPageReqVO;
|
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectDataReqVO;
|
|
||||||
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.BusinessAssayTaskDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||||
@@ -17,6 +14,7 @@ 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;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测项目数据业务 Mapper
|
* 检测项目数据业务 Mapper
|
||||||
@@ -97,11 +95,17 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
|||||||
|
|
||||||
default List<BusinessAssayProjectDataExtendRespVO> selectByBusinessAssayTaskDataIds(List<Long> businessAssayTaskDataIds) {
|
default List<BusinessAssayProjectDataExtendRespVO> selectByBusinessAssayTaskDataIds(List<Long> businessAssayTaskDataIds) {
|
||||||
return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayProjectDataDO>()
|
return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayProjectDataDO>()
|
||||||
|
.leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId)
|
||||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||||
.selectAll(BusinessAssayProjectDataDO.class)
|
.selectAll(BusinessAssayProjectDataDO.class)
|
||||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey)
|
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey)
|
||||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName)
|
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName)
|
||||||
.selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName)
|
.selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName)
|
||||||
|
.selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayProjectDataExtendRespVO::getAssayOperator)
|
||||||
|
.selectAs(BusinessAssayTaskDataDO::getAnalysisCount, BusinessAssayProjectDataExtendRespVO::getAnalysisCount)
|
||||||
|
.selectAs(BusinessAssayTaskDataDO::getBusinessBaseSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessBaseSampleId)
|
||||||
|
.selectAs(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubParentSampleId)
|
||||||
|
.selectAs(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessAssayProjectDataExtendRespVO::getBusinessSubSampleId)
|
||||||
.in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIds));
|
.in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,4 +134,6 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
|||||||
.eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()));
|
.eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<AssayMethodProjectRespVO> selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(@Param("businessSubSampleIdList")List<Long> businessSubSampleIdList, @Param("configAssayMethodId") Long configAssayMethodId);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -46,6 +46,11 @@ public interface BusinessAssayReportDataMapper extends BaseMapperX<BusinessAssay
|
|||||||
.eqIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleId));
|
.eqIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessAssayReportDataDO> selectBytBusinessBaseSampleIds(List<Long> businessBaseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessAssayReportDataDO>()
|
||||||
|
.inIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
//查询报告待编制数据
|
//查询报告待编制数据
|
||||||
Page<BusinessAssayReportDataDO> queryWaitingDataForReport(IPage<?> page, @Param("param") BusinessAssayReportDataPageReqVO param);
|
Page<BusinessAssayReportDataDO> queryWaitingDataForReport(IPage<?> page, @Param("param") BusinessAssayReportDataPageReqVO param);
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -47,6 +44,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(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
@@ -149,6 +147,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(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||||
@@ -264,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)
|
||||||
@@ -274,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)
|
||||||
@@ -395,7 +420,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据分样查询分析任务
|
* 根据分样查询分析任务
|
||||||
* @param businessSubParentSampleIds 分样样id
|
* @param businessSubParentSampleIds 分样样id列表
|
||||||
* @param configAssayMethodId 分析方法
|
* @param configAssayMethodId 分析方法
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
package com.zt.plat.module.qms.business.bus.dal.mapper;
|
package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||||
|
|
||||||
import java.util.*;
|
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.BusinessQCCoefficientDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
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;
|
||||||
|
|
||||||
@@ -82,4 +84,13 @@ public interface BusinessQCCoefficientDataMapper extends BaseMapperX<BusinessQCC
|
|||||||
.eq(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, dictionaryBusinessKey));
|
.eq(BusinessQCCoefficientDataDO::getDictionaryBusinessKey, dictionaryBusinessKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessQCCoefficientDataDO> selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List<String> sampleCodeList, String configAssayMethodDictionaryBusinessKey) {
|
||||||
|
return selectJoinList(BusinessQCCoefficientDataDO.class, new MPJLambdaWrapperX<BusinessQCCoefficientDataDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessQCCoefficientDataDO::getConfigAssayMethodId)
|
||||||
|
.selectAll(BusinessQCCoefficientDataDO.class)
|
||||||
|
.in(BusinessQCCoefficientDataDO::getSampleCode, sampleCodeList)
|
||||||
|
.eq(BusinessQCCoefficientDataDO::getIsReported, QmsCommonConstant.NO)
|
||||||
|
.eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,8 +4,11 @@ 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.BusinessQCManagementDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
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;
|
||||||
|
|
||||||
@@ -76,4 +79,13 @@ public interface BusinessQCManagementDataMapper extends BaseMapperX<BusinessQCMa
|
|||||||
.eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
.eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BusinessQCManagementDataDO> selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List<String> sampleCodeList, String configAssayMethodDictionaryBusinessKey){
|
||||||
|
return selectJoinList(BusinessQCManagementDataDO.class, new MPJLambdaWrapperX<BusinessQCManagementDataDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessQCManagementDataDO::getConfigAssayMethodId)
|
||||||
|
.selectAll(BusinessQCManagementDataDO.class)
|
||||||
|
.in(BusinessQCManagementDataDO::getSampleCode, sampleCodeList)
|
||||||
|
.eq(ConfigAssayMethodDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey)
|
||||||
|
.eq(BusinessQCManagementDataDO::getIsReported, QmsCommonConstant.NO));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|||||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
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.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||||
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.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;
|
||||||
@@ -49,9 +50,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
|||||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds,
|
default List<BusinessSubParentSampleAssessmentExtendRespVO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||||
Long configAssayMethodId) {
|
return selectJoinList(BusinessSubParentSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||||
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
.leftJoin(BusinessSubParentSampleDO.class, BusinessSubParentSampleDO::getId, BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId)
|
||||||
|
.selectAll(BusinessSubParentSampleAssessmentDO.class)
|
||||||
|
.selectAs(BusinessSubParentSampleDO::getConfigSubSampleParentId, BusinessSubParentSampleAssessmentExtendRespVO::getConfigSubSampleParentId)
|
||||||
|
.selectAs(BusinessSubParentSampleDO::getBusinessBaseSampleId, BusinessSubParentSampleAssessmentExtendRespVO::getBusinessBaseSampleId)
|
||||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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())
|
||||||
|
|||||||
@@ -37,6 +37,18 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX<BusinessS
|
|||||||
.orderByDesc(BusinessSubSampleAssessmentDO::getId));
|
.orderByDesc(BusinessSubSampleAssessmentDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default BusinessSubSampleAssessmentDO selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||||
|
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||||
|
.eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId)
|
||||||
|
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BusinessSubSampleAssessmentDO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||||
|
.in(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||||
|
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
|
}
|
||||||
|
|
||||||
default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
default BusinessSubSampleAssessmentDO selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
return selectOne(new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||||
.eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId)
|
.eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId)
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ 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())
|
||||||
|
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getIsSend, reqVO.getIsSendSample())
|
||||||
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
|
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public interface BusinessXRFDataMapper extends BaseMapperX<BusinessXRFDataDO> {
|
|||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
||||||
|
.eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
|
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
|
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
|
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
|
||||||
@@ -57,6 +58,7 @@ public interface BusinessXRFDataMapper extends BaseMapperX<BusinessXRFDataDO> {
|
|||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
.eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
||||||
|
.eqIfPresent(BusinessXRFDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
|
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
|
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
|
||||||
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
|
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ 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.ConfigAssayMethodProjectExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd;
|
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.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||||
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.ConfigAssayMethodProjectParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
@@ -205,7 +206,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
List<Long> configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//子样分析方法配置
|
//子样分析方法配置
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList);
|
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList);
|
||||||
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
//分析方法配置
|
//分析方法配置
|
||||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
||||||
@@ -413,7 +414,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
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);
|
ConfigSubSampleMethodExtendRespVO 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();
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
@@ -638,7 +639,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAssayTask(LocalDateTime currentDateTime, List<ConfigSubSampleMethodDO> configSubSampleMethodList,
|
private void addAssayTask(LocalDateTime currentDateTime, List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList,
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList,
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList,
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList,
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList,
|
||||||
List<DictionaryProjectDO> dictionaryProjectList,
|
List<DictionaryProjectDO> dictionaryProjectList,
|
||||||
@@ -655,7 +656,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
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);
|
ConfigSubSampleMethodExtendRespVO 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);
|
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
if (businessSubSampleAnalysisGroupDO == null) {
|
||||||
|
|||||||
@@ -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,7 +91,7 @@ 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().filter(f -> f.getBusinessSubSampleId().equals(businessSubSample.getId())).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()));
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -464,7 +459,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
|
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||||
//获取子样分析方法配置
|
//获取子样分析方法配置
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId());
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) {
|
if (QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL.equals(businessAssayTaskDataDO.getAssayType())) {
|
||||||
//根据子样id及分析方法id,查询未上报的分析任务
|
//根据子样id及分析方法id,查询未上报的分析任务
|
||||||
@@ -959,7 +954,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
//查询子样
|
//查询子样
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||||
//查询子样与方法的配置
|
//查询子样与方法的配置
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId);
|
||||||
|
|
||||||
//计算判定值计算规则
|
//计算判定值计算规则
|
||||||
ConfigRuleDO calculateAssessmentValue = configRuleMapper.selectLatestConfigRuleByCode(configSubSampleMethodDO.getCalculateMethod());
|
ConfigRuleDO calculateAssessmentValue = configRuleMapper.selectLatestConfigRuleByCode(configSubSampleMethodDO.getCalculateMethod());
|
||||||
@@ -991,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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ 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.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||||
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.ConfigAssayMethodProjectCoefficientDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectCoefficientDO;
|
||||||
@@ -201,7 +202,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//子样方法配置列表
|
//子样方法配置列表
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
|
||||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||||
@@ -242,7 +243,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
|
|
||||||
|
|
||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).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);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
if (StringUtils.isNotBlank(configInfomation)) {
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
@@ -558,7 +559,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//子样方法配置列表
|
//子样方法配置列表
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
List<ConfigSubSampleMethodExtendRespVO> 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());
|
||||||
@@ -599,7 +600,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
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);
|
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);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
if (StringUtils.isNotBlank(configInfomation)) {
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
@@ -1173,7 +1174,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
//子样配置id列表
|
//子样配置id列表
|
||||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
//子样配置方法
|
//子样配置方法
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||||
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
@@ -1185,7 +1186,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
||||||
|
|
||||||
//子样配置信息
|
//子样配置信息
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
if (StringUtils.isNotBlank(configInfomation)) {
|
if (StringUtils.isNotBlank(configInfomation)) {
|
||||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodRes
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||||
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.ConfigAssayMethodProjectDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
@@ -328,7 +329,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
|
|
||||||
//查询分析方法
|
//查询分析方法
|
||||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(configAssayMethodId);
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(configAssayMethodId);
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId);
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
||||||
|
|
||||||
@@ -501,7 +502,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);
|
||||||
@@ -583,7 +584,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
|||||||
List<BusinessSubParentSampleDO> currentBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleIds(currentBusinessBaseSampleIdList);
|
List<BusinessSubParentSampleDO> currentBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleIds(currentBusinessBaseSampleIdList);
|
||||||
List<Long> currentBusinessSubParentSampleIdList = currentBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> currentBusinessSubParentSampleIdList = currentBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
List<BusinessSubParentSampleAssessmentDO> currentBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIds(currentBusinessSubParentSampleIdList);
|
List<BusinessSubParentSampleAssessmentDO> currentBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIds(currentBusinessSubParentSampleIdList);
|
||||||
long count = currentBusinessSubParentSampleAssessmentDOList.stream().filter(f -> !reqVO.getBusinessSubParentSampleIds().contains(f.getBusinessSubParentSampleId()) && !f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
|
||||||
|
//排除不在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) {//如果还存在未上报的数据,则继续
|
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,15 @@ public interface SampleTaskAssignService {
|
|||||||
* @param configAssayMethodId
|
* @param configAssayMethodId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId);
|
// List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样id列表,查询分析方法项目
|
||||||
|
* @param businessSubSampleIdList 子样id列表
|
||||||
|
* @param configAssayMethodId 分析方法id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改分析方法
|
* 修改分析方法
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.zt.plat.module.qms.business.bus.service;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -11,7 +9,6 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
import com.yomahub.liteflow.core.FlowExecutor;
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
@@ -33,12 +30,11 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientDataDO;
|
||||||
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.bus.dal.dataobject.BusinessQCDataDO;
|
|
||||||
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.BusinessQCParameterDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCProjectDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||||
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;
|
||||||
@@ -48,12 +44,11 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMap
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCDataMapper;
|
|
||||||
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.BusinessQCParameterDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCProjectDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
||||||
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.SampleTaskAssignManualParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
||||||
@@ -64,7 +59,6 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethod
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||||
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.mapper.ConfigAssayMethodMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||||
@@ -116,6 +110,12 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessAssayReportDataMapper businessAssayReportDataMapper;
|
private BusinessAssayReportDataMapper businessAssayReportDataMapper;
|
||||||
|
|
||||||
@@ -188,6 +188,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
@Override
|
@Override
|
||||||
public List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
public List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
List<Object> resutList = new ArrayList<>();
|
List<Object> resutList = new ArrayList<>();
|
||||||
@@ -214,6 +215,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();
|
||||||
@@ -243,7 +245,471 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
|
|
||||||
return resutList;
|
return resutList;
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId) {
|
||||||
|
//当前登录用户
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Long visitDeptId = loginUser.getVisitDeptId();
|
||||||
|
|
||||||
|
List<BusinessSubSampleDO> businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||||
|
List<Long> configSubSampleIdList = businessSubSampleList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
//查询子样分析方法及检测项目
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigSubSampleIdsAndAssayDepartmentId(configSubSampleIdList, visitDeptId);
|
||||||
|
//查询分析方法检测项目
|
||||||
|
List<AssayMethodProjectRespVO> list = businessAssayProjectDataMapper.selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(businessSubSampleIdList, configAssayMethodId);
|
||||||
|
for (AssayMethodProjectRespVO assayMethodProject : list) {
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> methodList = configAssayMethodProjectList.stream().filter(f -> assayMethodProject.getDictionaryProjectId().equals(f.getDictionaryProjectId())).collect(Collectors.toList());
|
||||||
|
assayMethodProject.setMethodList(methodList);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void changeMethod(ChangeAssayMethodReqVO req) {
|
||||||
|
List<Long> businessSubSampleIdList = req.getBusinessSubSampleIdList();
|
||||||
|
Long configAssayMethodId = req.getConfigAssayMethodId();
|
||||||
|
List<AssayMethodProjectRespVO> changeConfigAssayMethodProjectList = req.getChangeConfigAssayMethodProjectList();
|
||||||
|
List<Long> changeConfigAssayMethodIdList = changeConfigAssayMethodProjectList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
LocalDateTime currentDateTime = LocalDateTime.now();
|
||||||
|
|
||||||
|
//需要更新的报表数据
|
||||||
|
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要更新的分析任务
|
||||||
|
List<BusinessAssayTaskDataDO> updateBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||||
|
//需要更新的分析任务检测项目
|
||||||
|
List<BusinessAssayProjectDataDO> updateBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||||
|
//需要更新的分析任务检测项目参数
|
||||||
|
List<BusinessAssayParameterDataDO> updateBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要更新的子样判定
|
||||||
|
List<BusinessSubSampleAssessmentDO> updateBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要更新的分样判定
|
||||||
|
List<BusinessSubParentSampleAssessmentDO> updateBusinessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要新建的分析任务
|
||||||
|
List<BusinessAssayTaskDataDO> saveBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||||
|
//需要新建的分析任务检测项目
|
||||||
|
List<BusinessAssayProjectDataDO> saveBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||||
|
//需要新建的分析任务检测项目参数
|
||||||
|
List<BusinessAssayParameterDataDO> saveBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要新建的子样判定
|
||||||
|
List<BusinessSubSampleAssessmentDO> saveBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要新建的分样判定
|
||||||
|
List<BusinessSubParentSampleAssessmentDO> saveBusinessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要删除的分析任务
|
||||||
|
List<Long> removeAssayTaskDataIdList = new ArrayList<>();
|
||||||
|
//需要删除的分析任务检测项目
|
||||||
|
List<Long> removeAssayProjectIdList = new ArrayList<>();
|
||||||
|
//需要删除的分析任务检测项目参数
|
||||||
|
List<Long> removeAssayParameterIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要删除的子样判定
|
||||||
|
List<Long> removeSubSampleAssessmentIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
//需要删除的分样判定
|
||||||
|
List<Long> removeSubParentSampleAssessmentIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
//查询子样
|
||||||
|
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||||
|
List<Long> businessBaseSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessBaseSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
List<Long> businessSubParentSampleIdList = businessSubSampleDOList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
//查询检测任务 (通过分样id,可以查询双杯样的)
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||||
|
|
||||||
|
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
||||||
|
if (disabled) {
|
||||||
|
throw new ServiceException(1_032_001_000, "当前样品存在已分配任务,不允许修改分析方法");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//查询检测任务的检测项目
|
||||||
|
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataIds(businessAssayTaskDataIdList);
|
||||||
|
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//查询检测任务的检测项目的参数
|
||||||
|
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
||||||
|
|
||||||
|
//查询子样判定 (通过分样id,可以查询双杯样的)
|
||||||
|
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||||
|
|
||||||
|
//查询分样判定
|
||||||
|
List<BusinessSubParentSampleAssessmentExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||||
|
|
||||||
|
//查询要变更的分析方法配置
|
||||||
|
List<ConfigAssayMethodDO> configAssayMethodDOList = configAssayMethodMapper.selectByIds(changeConfigAssayMethodIdList);
|
||||||
|
//分析方法检测项目配置
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList);
|
||||||
|
//分析方法检测项目参数配置
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(changeConfigAssayMethodIdList);
|
||||||
|
//查询要变更的子样及分析方法配置
|
||||||
|
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodIds(configSubSampleIdList, changeConfigAssayMethodIdList);
|
||||||
|
|
||||||
|
//循环分样判定
|
||||||
|
for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
||||||
|
|
||||||
|
//循环变更的分析方法
|
||||||
|
for (Long changeConfigAssayMethodId : changeConfigAssayMethodIdList) {
|
||||||
|
//如果当前分析方法不等于要变更的方法
|
||||||
|
if (!businessSubParentSampleAssessment.getConfigAssayMethodId().equals(changeConfigAssayMethodId)) {
|
||||||
|
//查询是否已有要变更的方法的分样判定
|
||||||
|
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessment.getBusinessSubParentSampleId(), changeConfigAssayMethodId);
|
||||||
|
if (businessSubParentSampleAssessmentDO == null) {//不存在
|
||||||
|
//根据变更方法过滤出检测项目
|
||||||
|
List<Long> projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//查询分析方法
|
||||||
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodDOList.stream().filter(f -> f.getId().equals(changeConfigAssayMethodId)).findFirst().orElse(null);
|
||||||
|
//查询子样分析方法
|
||||||
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleParentId().equals(businessSubParentSampleAssessment.getConfigSubSampleParentId()) && f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).findFirst().orElse(null);
|
||||||
|
|
||||||
|
//根据任务数判断是平行还是
|
||||||
|
String assayType = configSubSampleMethod.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||||
|
businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||||
|
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubParentSampleAssessment.getBusinessSubParentSampleId());
|
||||||
|
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(changeConfigAssayMethodId);
|
||||||
|
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||||
|
saveBusinessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||||
|
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = null;
|
||||||
|
if (!QmsCommonConstant.ASSAY_TYPE_DOUBLE_CUP.equals(businessSubParentSampleAssessment.getAssayType())) {//如果不为双杯样
|
||||||
|
businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).findFirst().orElse(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
//子样判定数据
|
||||||
|
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||||
|
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubParentSampleAssessment.getBusinessBaseSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubParentSampleAssessment.getBusinessSubParentSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||||
|
if (businessSubSampleDO != null) {
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
}
|
||||||
|
businessSubSampleAssessmentDO.setConfigAssayMethodId(changeConfigAssayMethodId);
|
||||||
|
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||||
|
|
||||||
|
saveBusinessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||||
|
|
||||||
|
//查询旧的检测项目
|
||||||
|
List<Long> oldBusinessAssayProjectDataIdList = businessAssayProjectDataList.stream().filter(f -> projectIdList.contains(f.getDictionaryProjectId()) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeAssayProjectIdList.addAll(oldBusinessAssayProjectDataIdList);
|
||||||
|
List<Long> oldBusinessAssayParameterDataIdList = businessAssayParameterDataDOList.stream().filter(f -> oldBusinessAssayProjectDataIdList.contains(f.getBusinessAssayProjectDataId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
removeAssayParameterIdList.addAll(oldBusinessAssayParameterDataIdList);
|
||||||
|
if (projectIdList.size() == changeConfigAssayMethodProjectList.size()) {
|
||||||
|
//查询旧的检测任务
|
||||||
|
List<Long> oldBusinessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeAssayTaskDataIdList.addAll(oldBusinessAssayTaskDataIdList);
|
||||||
|
//查询旧的子样判定
|
||||||
|
List<Long> oldBusinessSubSampleAssesmentIdList = businessSubSampleAssessmentDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeSubSampleAssessmentIdList.addAll(oldBusinessSubSampleAssesmentIdList);
|
||||||
|
|
||||||
|
//添加到删除列表
|
||||||
|
removeSubParentSampleAssessmentIdList.add(businessSubParentSampleAssessment.getId());
|
||||||
|
} else {
|
||||||
|
List<String> projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList());
|
||||||
|
//查询旧的检测任务
|
||||||
|
List<BusinessAssayTaskDataDO> oldBusinessAssayTaskDataList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||||
|
for (BusinessAssayTaskDataDO oldBusinessAssayTaskData : oldBusinessAssayTaskDataList) {
|
||||||
|
boolean isAdd = updateBusinessAssayTaskDataDOList.stream().anyMatch(m -> m.getId().equals(oldBusinessAssayTaskData.getId()));
|
||||||
|
if (!isAdd) {//如果未添加过更新,则修改检测项目并添加更新
|
||||||
|
oldBusinessAssayTaskData.setAssayProject(CollUtil.join(projectShowNameList, ","));
|
||||||
|
updateBusinessAssayTaskDataDOList.add(oldBusinessAssayTaskData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BusinessAssayTaskDataDO oldBusinessAssayTaskDataDO = businessAssayTaskDataDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
//根据检测方法循环
|
||||||
|
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||||
|
//根据任务数循环
|
||||||
|
for (int i = 0; i < configSubSampleMethod.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(changeConfigAssayMethodId);
|
||||||
|
businessAssayTaskDataDO.setAssayType(assayType);
|
||||||
|
businessAssayTaskDataDO.setTaskType("常规");
|
||||||
|
businessAssayTaskDataDO.setConfigSampleFlowId(oldBusinessAssayTaskDataDO.getConfigSampleFlowId());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeKey(oldBusinessAssayTaskDataDO.getSampleFlowNodeKey());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
|
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
assayProjectBuilder.append(configAssayMethodProjectDO.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_REPORT);
|
||||||
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
|
businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES);
|
||||||
|
businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO);
|
||||||
|
|
||||||
|
saveBusinessAssayProjectDataDOList.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());
|
||||||
|
|
||||||
|
saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (assayProjectBuilder.length() > 1) {
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
}
|
||||||
|
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||||
|
saveBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {//已存在
|
||||||
|
//根据变更方法过滤出检测项目
|
||||||
|
List<Long> projectIdList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).map(m -> m.getDictionaryProjectId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
//查询分析方法
|
||||||
|
//ConfigAssayMethodDO configAssayMethodDO = configAssayMethodDOList.stream().filter(f -> f.getId().equals(changeConfigAssayMethodId)).findFirst().orElse(null);
|
||||||
|
//查询子样分析方法
|
||||||
|
//ConfigSubSampleMethodExtendRespVO configSubSampleMethod = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleParentId().equals(businessSubParentSampleAssessment.getConfigSubSampleParentId()) && f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).findFirst().orElse(null);
|
||||||
|
|
||||||
|
//根据任务数判断是平行还是
|
||||||
|
//String assayType = configSubSampleMethod.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||||
|
|
||||||
|
//查询子样判定
|
||||||
|
//BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessmentDO.getBusinessSubParentSampleId(), changeConfigAssayMethodId);
|
||||||
|
|
||||||
|
//查询旧的检测项目
|
||||||
|
List<Long> oldBusinessAssayProjectDataIdList = businessAssayProjectDataList.stream().filter(f -> projectIdList.contains(f.getDictionaryProjectId()) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeAssayProjectIdList.addAll(oldBusinessAssayProjectDataIdList);
|
||||||
|
List<Long> oldBusinessAssayParameterDataIdList = businessAssayParameterDataDOList.stream().filter(f -> oldBusinessAssayProjectDataIdList.contains(f.getBusinessAssayProjectDataId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
removeAssayParameterIdList.addAll(oldBusinessAssayParameterDataIdList);
|
||||||
|
if (projectIdList.size() == changeConfigAssayMethodProjectList.size()) {
|
||||||
|
//查询旧的检测任务
|
||||||
|
List<Long> oldBusinessAssayTaskDataIdList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeAssayTaskDataIdList.addAll(oldBusinessAssayTaskDataIdList);
|
||||||
|
//查询旧的子样判定
|
||||||
|
List<Long> oldBusinessSubSampleAssesmentIdList = businessSubSampleAssessmentDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
//添加到删除列表
|
||||||
|
removeSubSampleAssessmentIdList.addAll(oldBusinessSubSampleAssesmentIdList);
|
||||||
|
|
||||||
|
//添加到删除列表
|
||||||
|
removeSubParentSampleAssessmentIdList.add(businessSubParentSampleAssessment.getId());
|
||||||
|
} else {
|
||||||
|
List<String> projectShowNameList = changeConfigAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).map(m -> m.getDictionaryProjectShowName()).distinct().collect(Collectors.toList());
|
||||||
|
//查询旧的检测任务
|
||||||
|
List<BusinessAssayTaskDataDO> oldBusinessAssayTaskDataList = businessAssayTaskDataDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getBusinessSubParentSampleId().equals(businessSubParentSampleAssessment.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||||
|
for (BusinessAssayTaskDataDO oldBusinessAssayTaskData : oldBusinessAssayTaskDataList) {
|
||||||
|
boolean isAdd = updateBusinessAssayTaskDataDOList.stream().anyMatch(m -> m.getId().equals(oldBusinessAssayTaskData.getId()));
|
||||||
|
if (!isAdd) {//如果未添加过更新,则修改检测项目并添加更新
|
||||||
|
oldBusinessAssayTaskData.setAssayProject(CollUtil.join(projectShowNameList, ","));
|
||||||
|
updateBusinessAssayTaskDataDOList.add(oldBusinessAssayTaskData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询当前存在的分析任务
|
||||||
|
List<BusinessAssayTaskDataDO> currBusinessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleAssessmentDO.getBusinessSubParentSampleId(), changeConfigAssayMethodId);
|
||||||
|
|
||||||
|
//当前存在的分析任务循环
|
||||||
|
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : currBusinessAssayTaskDataDOList) {
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(changeConfigAssayMethodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder(businessAssayTaskDataDO.getAssayProject());
|
||||||
|
assayProjectBuilder.append(",");
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
|
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
assayProjectBuilder.append(configAssayMethodProjectDO.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_REPORT);
|
||||||
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
|
businessAssayProjectDataDO.setIsEnabled(QmsCommonConstant.YES);
|
||||||
|
businessAssayProjectDataDO.setIsNotAssessment(QmsCommonConstant.NO);
|
||||||
|
|
||||||
|
saveBusinessAssayProjectDataDOList.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());
|
||||||
|
|
||||||
|
saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (assayProjectBuilder.length() > 1) {
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
}
|
||||||
|
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||||
|
updateBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询报表数据
|
||||||
|
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleIds(businessBaseSampleIdList);
|
||||||
|
for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) {
|
||||||
|
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||||
|
if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在
|
||||||
|
List<Long> dataSourceList = new ArrayList<>();
|
||||||
|
String[] dataSourceSplit = dataSource.split(",");
|
||||||
|
for (int i = 0; i < dataSourceSplit.length; i++) {
|
||||||
|
dataSourceList.add(Long.parseLong(dataSourceSplit[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
//移除当前的
|
||||||
|
dataSourceList.remove(req.getConfigAssayMethodId());
|
||||||
|
//添加新的
|
||||||
|
dataSourceList.addAll(changeConfigAssayMethodIdList);
|
||||||
|
|
||||||
|
//重新赋值
|
||||||
|
businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ","));
|
||||||
|
|
||||||
|
//添加到更新列表
|
||||||
|
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//======================== 删除 =====================================================================
|
||||||
|
|
||||||
|
if (removeAssayTaskDataIdList.size() > 0) {
|
||||||
|
businessAssayTaskDataMapper.deleteByIds(removeAssayTaskDataIdList);
|
||||||
|
}
|
||||||
|
if (removeAssayProjectIdList.size() > 0) {
|
||||||
|
businessAssayProjectDataMapper.deleteByIds(removeAssayProjectIdList);
|
||||||
|
}
|
||||||
|
if (removeAssayParameterIdList.size() > 0) {
|
||||||
|
businessAssayParameterDataMapper.deleteByIds(removeAssayParameterIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (removeSubSampleAssessmentIdList.size() > 0) {
|
||||||
|
businessSubSampleAssessmentMapper.deleteByIds(removeSubSampleAssessmentIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (removeSubParentSampleAssessmentIdList.size() > 0) {
|
||||||
|
businessSubParentSampleAssessmentMapper.deleteByIds(removeSubParentSampleAssessmentIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//======================== 修改 =====================================================================
|
||||||
|
|
||||||
|
if (updateBusinessAssayReportDataDOList.size() > 0) {
|
||||||
|
businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateBusinessAssayTaskDataDOList.size() > 0) {
|
||||||
|
businessAssayTaskDataMapper.updateBatch(updateBusinessAssayTaskDataDOList);
|
||||||
|
}
|
||||||
|
if (updateBusinessAssayProjectDataDOList.size() > 0) {
|
||||||
|
businessAssayProjectDataMapper.updateBatch(updateBusinessAssayProjectDataDOList);
|
||||||
|
}
|
||||||
|
if (updateBusinessAssayParameterDataDOList.size() > 0) {
|
||||||
|
businessAssayParameterDataMapper.updateBatch(updateBusinessAssayParameterDataDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateBusinessSubSampleAssessmentDOList.size() > 0) {
|
||||||
|
businessSubSampleAssessmentMapper.updateBatch(updateBusinessSubSampleAssessmentDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updateBusinessSubParentSampleAssessmentDOList.size() > 0) {
|
||||||
|
businessSubParentSampleAssessmentMapper.updateBatch(updateBusinessSubParentSampleAssessmentDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//======================== 新建 =====================================================================
|
||||||
|
|
||||||
|
if (saveBusinessAssayTaskDataDOList.size() > 0) {
|
||||||
|
businessAssayTaskDataMapper.insertBatch(saveBusinessAssayTaskDataDOList);
|
||||||
|
}
|
||||||
|
if (saveBusinessAssayProjectDataDOList.size() > 0) {
|
||||||
|
businessAssayProjectDataMapper.insertBatch(saveBusinessAssayProjectDataDOList);
|
||||||
|
}
|
||||||
|
if (saveBusinessAssayParameterDataDOList.size() > 0) {
|
||||||
|
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveBusinessSubSampleAssessmentDOList.size() > 0) {
|
||||||
|
businessSubSampleAssessmentMapper.insertBatch(saveBusinessSubSampleAssessmentDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveBusinessSubParentSampleAssessmentDOList.size() > 0) {
|
||||||
|
businessSubParentSampleAssessmentMapper.insertBatch(saveBusinessSubParentSampleAssessmentDOList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void changeMethod(ChangeAssayMethodReqVO req) {
|
public void changeMethod(ChangeAssayMethodReqVO req) {
|
||||||
@@ -382,6 +848,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
**/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
|||||||
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.service.ConfigSubSampleMethodService;
|
import com.zt.plat.module.qms.business.config.service.ConfigSubSampleMethodService;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 子样与检测方法配置")
|
@Tag(name = "管理后台 - 子样与分样检测方法配置表")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/qms/config-sub-sample-method")
|
@RequestMapping("/qms/config-sub-sample-method")
|
||||||
@Validated
|
@Validated
|
||||||
@@ -45,14 +45,14 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
private ConfigSubSampleMethodService configSubSampleMethodService;
|
private ConfigSubSampleMethodService configSubSampleMethodService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建子样与检测方法配置")
|
@Operation(summary = "创建子样与分样检测方法配置表")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:create')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:create')")
|
||||||
public CommonResult<ConfigSubSampleMethodRespVO> createConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO createReqVO) {
|
public CommonResult<ConfigSubSampleMethodRespVO> createConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO createReqVO) {
|
||||||
return success(configSubSampleMethodService.createConfigSubSampleMethod(createReqVO));
|
return success(configSubSampleMethodService.createConfigSubSampleMethod(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新子样与检测方法配置")
|
@Operation(summary = "更新子样与分样检测方法配置表")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:update')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:update')")
|
||||||
public CommonResult<Boolean> updateConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateConfigSubSampleMethod(@Valid @RequestBody ConfigSubSampleMethodSaveReqVO updateReqVO) {
|
||||||
configSubSampleMethodService.updateConfigSubSampleMethod(updateReqVO);
|
configSubSampleMethodService.updateConfigSubSampleMethod(updateReqVO);
|
||||||
@@ -60,7 +60,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除子样与检测方法配置")
|
@Operation(summary = "删除子样与分样检测方法配置表")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')")
|
||||||
public CommonResult<Boolean> deleteConfigSubSampleMethod(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteConfigSubSampleMethod(@RequestParam("id") Long id) {
|
||||||
@@ -70,7 +70,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
|
|
||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除子样与检测方法配置")
|
@Operation(summary = "批量删除子样与分样检测方法配置表")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:delete')")
|
||||||
public CommonResult<Boolean> deleteConfigSubSampleMethodList(@RequestBody BatchDeleteReqVO req) {
|
public CommonResult<Boolean> deleteConfigSubSampleMethodList(@RequestBody BatchDeleteReqVO req) {
|
||||||
configSubSampleMethodService.deleteConfigSubSampleMethodListByIds(req.getIds());
|
configSubSampleMethodService.deleteConfigSubSampleMethodListByIds(req.getIds());
|
||||||
@@ -78,7 +78,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得子样与检测方法配置")
|
@Operation(summary = "获得子样与分样检测方法配置表")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')")
|
||||||
public CommonResult<ConfigSubSampleMethodRespVO> getConfigSubSampleMethod(@RequestParam("id") Long id) {
|
public CommonResult<ConfigSubSampleMethodRespVO> getConfigSubSampleMethod(@RequestParam("id") Long id) {
|
||||||
@@ -87,7 +87,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得子样与检测方法配置分页")
|
@Operation(summary = "获得子样与分样检测方法配置表分页")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:query')")
|
||||||
public CommonResult<PageResult<ConfigSubSampleMethodRespVO>> getConfigSubSampleMethodPage(@Valid ConfigSubSampleMethodPageReqVO pageReqVO) {
|
public CommonResult<PageResult<ConfigSubSampleMethodRespVO>> getConfigSubSampleMethodPage(@Valid ConfigSubSampleMethodPageReqVO pageReqVO) {
|
||||||
PageResult<ConfigSubSampleMethodDO> pageResult = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO);
|
PageResult<ConfigSubSampleMethodDO> pageResult = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO);
|
||||||
@@ -95,7 +95,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出子样与检测方法配置 Excel")
|
@Operation(summary = "导出子样与分样检测方法配置表 Excel")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:export')")
|
//@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-method:export')")
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
public void exportConfigSubSampleMethodExcel(@Valid ConfigSubSampleMethodPageReqVO pageReqVO,
|
public void exportConfigSubSampleMethodExcel(@Valid ConfigSubSampleMethodPageReqVO pageReqVO,
|
||||||
@@ -103,7 +103,7 @@ public class ConfigSubSampleMethodController implements BusinessControllerMarker
|
|||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<ConfigSubSampleMethodDO> list = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO).getList();
|
List<ConfigSubSampleMethodDO> list = configSubSampleMethodService.getConfigSubSampleMethodPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "子样与检测方法配置.xls", "数据", ConfigSubSampleMethodRespVO.class,
|
ExcelUtils.write(response, "子样与分样检测方法配置表.xls", "数据", ConfigSubSampleMethodRespVO.class,
|
||||||
BeanUtils.toBean(list, ConfigSubSampleMethodRespVO.class));
|
BeanUtils.toBean(list, ConfigSubSampleMethodRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,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;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProjectRespVO {
|
public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProjectRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "分析方法名称")
|
||||||
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置名称及类别")
|
||||||
|
private String configAssayMethodNameAndCategory;
|
||||||
|
|
||||||
@Schema(description = "检测项目key")
|
@Schema(description = "检测项目key")
|
||||||
private String dictionaryProjectKey;
|
private String dictionaryProjectKey;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,28 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodRespVO {
|
public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "样品大类ID", example = "15082")
|
||||||
|
private Long baseSampleId;
|
||||||
|
|
||||||
|
@Schema(description = "主样配置ID", example = "1906")
|
||||||
|
private Long configBaseSampleId;
|
||||||
|
|
||||||
|
@Schema(description = "分样配置ID", example = "13652")
|
||||||
|
private Long configSubSampleParentId;
|
||||||
|
|
||||||
|
@Schema(description = "分析方法id")
|
||||||
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "是否默认使用,1-是,0-否")
|
||||||
|
private Integer isDefaultUse;
|
||||||
|
|
||||||
/** 分析方法名称 **/
|
/** 分析方法名称 **/
|
||||||
@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;
|
||||||
|
|||||||
@@ -9,18 +9,15 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 子样与检测方法配置分页 Request VO")
|
@Schema(description = "管理后台 - 子样与分样检测方法配置表分页 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class ConfigSubSampleMethodPageReqVO extends PageParam {
|
public class ConfigSubSampleMethodPageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "子样配置ID", example = "27079")
|
@Schema(description = "子样配置ID", example = "27079")
|
||||||
private Long configSubSampleId;
|
private Long configSubSampleId;
|
||||||
|
|
||||||
@Schema(description = "检测方法配置ID", example = "30543")
|
@Schema(description = "分样与检测方法配置ID", example = "30543")
|
||||||
private Long configAssayMethodId;
|
private Long configSubSampleParentMethodId;
|
||||||
|
|
||||||
@Schema(description = "是否默认使用,1-启用,0-不启用")
|
|
||||||
private Integer isDefaultUse;
|
|
||||||
|
|
||||||
@Schema(description = "任务数", example = "27414")
|
@Schema(description = "任务数", example = "27414")
|
||||||
private Integer taskCount;
|
private Integer taskCount;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import com.alibaba.excel.annotation.*;
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 子样与检测方法配置 Response VO")
|
@Schema(description = "管理后台 - 子样与分样检测方法配置表 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class ConfigSubSampleMethodRespVO {
|
public class ConfigSubSampleMethodRespVO {
|
||||||
@@ -20,13 +20,8 @@ public class ConfigSubSampleMethodRespVO {
|
|||||||
@ExcelProperty("子样配置ID")
|
@ExcelProperty("子样配置ID")
|
||||||
private Long configSubSampleId;
|
private Long configSubSampleId;
|
||||||
|
|
||||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543")
|
@Schema(description = "分样与检测方法配置ID", example = "30543")
|
||||||
@ExcelProperty("检测方法配置ID")
|
private Long configSubSampleParentMethodId;
|
||||||
private Long configAssayMethodId;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("是否默认使用,1-启用,0-不启用")
|
|
||||||
private Integer isDefaultUse;
|
|
||||||
|
|
||||||
@Schema(description = "任务数", example = "27414")
|
@Schema(description = "任务数", example = "27414")
|
||||||
@ExcelProperty("任务数")
|
@ExcelProperty("任务数")
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import lombok.*;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 子样与检测方法配置新增/修改 Request VO")
|
@Schema(description = "管理后台 - 子样与分样检测方法配置表新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class ConfigSubSampleMethodSaveReqVO {
|
public class ConfigSubSampleMethodSaveReqVO {
|
||||||
|
|
||||||
@@ -16,13 +16,8 @@ public class ConfigSubSampleMethodSaveReqVO {
|
|||||||
@NotNull(message = "子样配置ID不能为空")
|
@NotNull(message = "子样配置ID不能为空")
|
||||||
private Long configSubSampleId;
|
private Long configSubSampleId;
|
||||||
|
|
||||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30543")
|
@Schema(description = "分样与检测方法配置ID", example = "30543")
|
||||||
@NotNull(message = "检测方法配置ID不能为空")
|
private Long configSubSampleParentMethodId;
|
||||||
private Long configAssayMethodId;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认使用,1-启用,0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "是否默认使用,1-启用,0-不启用不能为空")
|
|
||||||
private Integer isDefaultUse;
|
|
||||||
|
|
||||||
@Schema(description = "任务数", example = "27414")
|
@Schema(description = "任务数", example = "27414")
|
||||||
private Integer taskCount;
|
private Integer taskCount;
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public class ConfigSubSampleParentMethodPageReqVO extends PageParam {
|
|||||||
@Schema(description = "检测方法配置ID", example = "24094")
|
@Schema(description = "检测方法配置ID", example = "24094")
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "是否默认使用,1-启用,0-不启用")
|
||||||
|
private Integer isDefaultUse;
|
||||||
|
|
||||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||||
private String resultTreatmentWay;
|
private String resultTreatmentWay;
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ public class ConfigSubSampleParentMethodRespVO {
|
|||||||
@ExcelProperty("检测方法配置ID")
|
@ExcelProperty("检测方法配置ID")
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "是否默认使用,1-启用,0-不启用")
|
||||||
|
private Integer isDefaultUse;
|
||||||
|
|
||||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||||
@ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
@ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||||
private String resultTreatmentWay;
|
private String resultTreatmentWay;
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ public class ConfigSubSampleParentMethodSaveReqVO {
|
|||||||
@NotNull(message = "检测方法配置ID不能为空")
|
@NotNull(message = "检测方法配置ID不能为空")
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "是否默认使用,1-启用,0-不启用")
|
||||||
|
private Integer isDefaultUse;
|
||||||
|
|
||||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||||
private String resultTreatmentWay;
|
private String resultTreatmentWay;
|
||||||
|
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import java.util.*;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
/**
|
/**
|
||||||
* 子样与检测方法配置 DO
|
* 子样与分样检测方法配置表 DO
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
@@ -37,15 +37,10 @@ public class ConfigSubSampleMethodDO extends BusinessBaseDO {
|
|||||||
@TableField("CFG_SB_SMP_ID")
|
@TableField("CFG_SB_SMP_ID")
|
||||||
private Long configSubSampleId;
|
private Long configSubSampleId;
|
||||||
/**
|
/**
|
||||||
* 检测方法配置ID
|
* 分样与检测方法配置ID
|
||||||
*/
|
*/
|
||||||
@TableField("CFG_ASY_MTHD_ID")
|
@TableField("CFG_SB_SMP_PRN_MTHD_ID")
|
||||||
private Long configAssayMethodId;
|
private Long configSubSampleParentMethodId;
|
||||||
/**
|
|
||||||
* 是否默认使用,1-是,0-否
|
|
||||||
*/
|
|
||||||
@TableField("IS_DFT_USE")
|
|
||||||
private Integer isDefaultUse;
|
|
||||||
/**
|
/**
|
||||||
* 任务数
|
* 任务数
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ public class ConfigSubSampleParentMethodDO extends BusinessBaseDO {
|
|||||||
@TableField("CFG_ASY_MTHD_ID")
|
@TableField("CFG_ASY_MTHD_ID")
|
||||||
private Long configAssayMethodId;
|
private Long configAssayMethodId;
|
||||||
/**
|
/**
|
||||||
|
* 是否默认使用,1-是,0-否
|
||||||
|
*/
|
||||||
|
@TableField("IS_DFT_USE")
|
||||||
|
private Integer isDefaultUse;
|
||||||
|
/**
|
||||||
* 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改
|
* 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改
|
||||||
*/
|
*/
|
||||||
@TableField("RSLT_TMT_WY")
|
@TableField("RSLT_TMT_WY")
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public interface ConfigAssayMethodMapper extends BaseMapperX<ConfigAssayMethodDO
|
|||||||
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
||||||
.likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName())
|
.likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ConfigAssayMethodDO::getMethodNameCategory, reqVO.getMethodNameCategory())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode())
|
.eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription())
|
.eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getIsEnabled, reqVO.getIsEnabled())
|
.eqIfPresent(ConfigAssayMethodDO::getIsEnabled, reqVO.getIsEnabled())
|
||||||
@@ -51,6 +52,7 @@ public interface ConfigAssayMethodMapper extends BaseMapperX<ConfigAssayMethodDO
|
|||||||
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
.eqIfPresent(ConfigAssayMethodDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
||||||
.likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName())
|
.likeIfPresent(ConfigAssayMethodDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ConfigAssayMethodDO::getMethodNameCategory, reqVO.getMethodNameCategory())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode())
|
.eqIfPresent(ConfigAssayMethodDO::getMethodCode, reqVO.getMethodCode())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription())
|
.eqIfPresent(ConfigAssayMethodDO::getDescription, reqVO.getDescription())
|
||||||
.eqIfPresent(ConfigAssayMethodDO::getDataCollectionKey, reqVO.getDataCollectionKey())
|
.eqIfPresent(ConfigAssayMethodDO::getDataCollectionKey, reqVO.getDataCollectionKey())
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
|||||||
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.config.controller.vo.*;
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO;
|
||||||
|
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.ConfigAssayMethodProjectDO;
|
||||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
@@ -64,4 +65,26 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX<ConfigAssayM
|
|||||||
.in(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodIds));
|
.in(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样配置及分析部门查询检测项目
|
||||||
|
* @param configSubSampleIds 子样配置
|
||||||
|
* @param assayDepartmentId 分析部门
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default List<ConfigAssayMethodProjectExtendRespVO> selectByConfigSubSampleIdsAndAssayDepartmentId(List<Long> configSubSampleIds, Long assayDepartmentId) {
|
||||||
|
StringBuilder inSql = new StringBuilder("SELECT tcssm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm WHERE tcssm.DELETED = 0 AND tcssm.CFG_SB_SMP_ID IN (");
|
||||||
|
for (Long configSubSampleId : configSubSampleIds) {
|
||||||
|
inSql.append(configSubSampleId).append(",");
|
||||||
|
}
|
||||||
|
inSql.delete(inSql.length() - 1, inSql.length());
|
||||||
|
inSql.append(")");
|
||||||
|
return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX<ConfigAssayMethodProjectDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigAssayMethodProjectDO::getConfigAssayMethodId)
|
||||||
|
.selectAll(ConfigAssayMethodProjectDO.class)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getName, ConfigAssayMethodProjectExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, ConfigAssayMethodProjectExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
|
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId)
|
||||||
|
.inSql(ConfigAssayMethodProjectDO::getConfigAssayMethodId, inSql.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
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.controller.vo.ConfigSubSampleMethodPageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO;
|
||||||
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.ConfigSubSampleDO;
|
||||||
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.dataobject.ConfigSubSampleParentMethodDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -15,7 +16,7 @@ import java.util.List;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子样与检测方法配置 Mapper
|
* 子样与分样检测方法配置表 Mapper
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
@@ -25,8 +26,7 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
|||||||
default PageResult<ConfigSubSampleMethodDO> selectPage(ConfigSubSampleMethodPageReqVO reqVO) {
|
default PageResult<ConfigSubSampleMethodDO> selectPage(ConfigSubSampleMethodPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleMethodDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleMethodDO>()
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleId, reqVO.getConfigSubSampleId())
|
.eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleId, reqVO.getConfigSubSampleId())
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.eqIfPresent(ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId, reqVO.getConfigSubSampleParentMethodId())
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getIsDefaultUse, reqVO.getIsDefaultUse())
|
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getTaskCount, reqVO.getTaskCount())
|
.eqIfPresent(ConfigSubSampleMethodDO::getTaskCount, reqVO.getTaskCount())
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay())
|
.eqIfPresent(ConfigSubSampleMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay())
|
||||||
.eqIfPresent(ConfigSubSampleMethodDO::getAssessmentMethod, reqVO.getAssessmentMethod())
|
.eqIfPresent(ConfigSubSampleMethodDO::getAssessmentMethod, reqVO.getAssessmentMethod())
|
||||||
@@ -40,28 +40,58 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
|||||||
|
|
||||||
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdAndAssayDepartmentId(Long configSubSampleId, Long assayDepartmentId) {
|
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdAndAssayDepartmentId(Long configSubSampleId, Long assayDepartmentId) {
|
||||||
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleMethodDO::getConfigAssayMethodId)
|
.leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId)
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleParentMethodDO::getConfigAssayMethodId)
|
||||||
.selectAll(ConfigSubSampleMethodDO.class)
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||||
.selectAs(ConfigAssayMethodDO::getName, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodName)
|
.selectAs(ConfigAssayMethodDO::getName, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode)
|
.selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode)
|
||||||
.eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId)
|
.eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId)
|
||||||
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default ConfigSubSampleMethodDO selectByConfigSubSampleIdAndConfigAssayMethodId(Long configSubSampleId, Long configAssayMethodId) {
|
default ConfigSubSampleMethodExtendRespVO selectByConfigSubSampleIdAndConfigAssayMethodId(Long configSubSampleId, Long configAssayMethodId) {
|
||||||
return selectOne(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
|
return selectJoinOne(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
|
.leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId)
|
||||||
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||||
.eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId)
|
.eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId)
|
||||||
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIdsAndConfigAssayMethodId(List<Long> configSubSampleIds, Long configAssayMethodId) {
|
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdsAndConfigAssayMethodId(List<Long> configSubSampleIds, Long configAssayMethodId) {
|
||||||
return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
|
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
|
.leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId)
|
||||||
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
||||||
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) {
|
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdsAndConfigAssayMethodIds(List<Long> configSubSampleIds, List<Long> configAssayMethodIds) {
|
||||||
return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
|
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
|
.leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId)
|
||||||
|
.leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleId)
|
||||||
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||||
|
.selectAs(ConfigSubSampleDO::getConfigSubSampleParentId, ConfigSubSampleMethodExtendRespVO::getConfigSubSampleParentId)
|
||||||
|
.selectAs(ConfigSubSampleDO::getConfigBaseSampleId, ConfigSubSampleMethodExtendRespVO::getConfigBaseSampleId)
|
||||||
|
.selectAs(ConfigSubSampleDO::getBaseSampleId, ConfigSubSampleMethodExtendRespVO::getBaseSampleId)
|
||||||
|
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
||||||
|
.in(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) {
|
||||||
|
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
|
.leftJoin(ConfigSubSampleParentMethodDO.class, ConfigSubSampleParentMethodDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleParentMethodId)
|
||||||
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodId)
|
||||||
|
.selectAs(ConfigSubSampleParentMethodDO::getIsDefaultUse, ConfigSubSampleMethodExtendRespVO::getIsDefaultUse)
|
||||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));
|
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public interface ConfigSubSampleParentMethodMapper extends BaseMapperX<ConfigSub
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleParentMethodDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleParentMethodDO>()
|
||||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId())
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId())
|
||||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||||
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getIsDefaultUse, reqVO.getIsDefaultUse())
|
||||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay())
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay())
|
||||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getCalculateMethod, reqVO.getCalculateMethod())
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getCalculateMethod, reqVO.getCalculateMethod())
|
||||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(ConfigSubSampleParentMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
|||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子样与检测方法配置 Service 接口
|
* 子样与分样检测方法配置表 Service 接口
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
public interface ConfigSubSampleMethodService {
|
public interface ConfigSubSampleMethodService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建子样与检测方法配置
|
* 创建子样与分样检测方法配置表
|
||||||
*
|
*
|
||||||
* @param createReqVO 创建信息
|
* @param createReqVO 创建信息
|
||||||
* @return 编号
|
* @return 编号
|
||||||
@@ -27,39 +27,39 @@ public interface ConfigSubSampleMethodService {
|
|||||||
ConfigSubSampleMethodRespVO createConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO createReqVO);
|
ConfigSubSampleMethodRespVO createConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新子样与检测方法配置
|
* 更新子样与分样检测方法配置表
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
*/
|
*/
|
||||||
void updateConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO updateReqVO);
|
void updateConfigSubSampleMethod(@Valid ConfigSubSampleMethodSaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除子样与检测方法配置
|
* 删除子样与分样检测方法配置表
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteConfigSubSampleMethod(Long id);
|
void deleteConfigSubSampleMethod(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除子样与检测方法配置
|
* 批量删除子样与分样检测方法配置表
|
||||||
*
|
*
|
||||||
* @param ids 编号
|
* @param ids 编号
|
||||||
*/
|
*/
|
||||||
void deleteConfigSubSampleMethodListByIds(List<Long> ids);
|
void deleteConfigSubSampleMethodListByIds(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得子样与检测方法配置
|
* 获得子样与分样检测方法配置表
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 子样与检测方法配置
|
* @return 子样与分样检测方法配置表
|
||||||
*/
|
*/
|
||||||
ConfigSubSampleMethodDO getConfigSubSampleMethod(Long id);
|
ConfigSubSampleMethodDO getConfigSubSampleMethod(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得子样与检测方法配置分页
|
* 获得子样与分样检测方法配置表分页
|
||||||
*
|
*
|
||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 子样与检测方法配置分页
|
* @return 子样与分样检测方法配置表分页
|
||||||
*/
|
*/
|
||||||
PageResult<ConfigSubSampleMethodDO> getConfigSubSampleMethodPage(ConfigSubSampleMethodPageReqVO pageReqVO);
|
PageResult<ConfigSubSampleMethodDO> getConfigSubSampleMethodPage(ConfigSubSampleMethodPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import static com.zt.plat.framework.common.util.collection.CollectionUtils.conve
|
|||||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS;
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.CONFIG_SUB_SAMPLE_METHOD_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 子样与检测方法配置 Service 实现类
|
* 子样与分样检测方法配置表 Service 实现类
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.async;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync
|
||||||
|
public class AsyncConfig {
|
||||||
|
@Bean("asyncTaskExecutor")
|
||||||
|
public Executor asyncTaskExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(5);
|
||||||
|
executor.setMaxPoolSize(10);
|
||||||
|
executor.setQueueCapacity(100);
|
||||||
|
executor.setThreadNamePrefix("Async-");
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,6 +21,7 @@ import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTy
|
|||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
||||||
|
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@@ -62,16 +63,12 @@ public class ReportDocumentDataController extends AbstractFileUploadController i
|
|||||||
@GetMapping("/queryReportDetail")
|
@GetMapping("/queryReportDetail")
|
||||||
@Operation(summary = "查询报告明细数据")
|
@Operation(summary = "查询报告明细数据")
|
||||||
@Parameter(name = "mainId", description = "报告id", required = true, example = "1024")
|
@Parameter(name = "mainId", description = "报告id", required = true, example = "1024")
|
||||||
public CommonResult<List<JSONObject>> queryReportDetail(@RequestParam("mainId") Long mainId) {
|
public CommonResult<?> queryReportDetail(@RequestParam("mainId") Long mainId, @RequestParam(name = "pageFlag", required = false) String pageFlag) {
|
||||||
|
|
||||||
ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId);
|
ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId);
|
||||||
Long typeId = mainDO.getReportDocumentTypeId();
|
Long typeId = mainDO.getReportDocumentTypeId();
|
||||||
ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId);
|
ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId);
|
||||||
Long confId = typeDO.getConfigReportTypeId();
|
CommonResult<JSONArray> result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO, pageFlag);
|
||||||
// Map<String, Object> param = new HashMap<>();
|
|
||||||
// List<ReportDocumentDataDO> list = reportDocumentDataService.listByMainDataId(mainId).getData();
|
|
||||||
// return success(BeanUtils.toBean(list, ReportDocumentDataRespVO.class));
|
|
||||||
CommonResult<List<JSONObject>> result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
|
||||||
|
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 com.zt.plat.framework.business.annotation.FileUploadController;
|
||||||
|
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||||
|
|
||||||
|
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.*;
|
||||||
|
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.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentFileService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 检测报告附件")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/report-document-file")
|
||||||
|
@Validated
|
||||||
|
@FileUploadController(source = "qms.reportdocumentfile")
|
||||||
|
public class ReportDocumentFileController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||||
|
|
||||||
|
static {
|
||||||
|
FileUploadController annotation = ReportDocumentFileController.class.getAnnotation(FileUploadController.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
setFileUploadInfo(annotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ReportDocumentFileService reportDocumentFileService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建检测报告附件")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:create')")
|
||||||
|
public CommonResult<ReportDocumentFileRespVO> createReportDocumentFile(@Valid @RequestBody ReportDocumentFileSaveReqVO createReqVO) {
|
||||||
|
return success(reportDocumentFileService.createReportDocumentFile(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新检测报告附件")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:update')")
|
||||||
|
public CommonResult<Boolean> updateReportDocumentFile(@Valid @RequestBody ReportDocumentFileSaveReqVO updateReqVO) {
|
||||||
|
reportDocumentFileService.updateReportDocumentFile(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除检测报告附件")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:delete')")
|
||||||
|
public CommonResult<Boolean> deleteReportDocumentFile(@RequestParam("id") Long id) {
|
||||||
|
reportDocumentFileService.deleteReportDocumentFile(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除检测报告附件")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:delete')")
|
||||||
|
public CommonResult<Boolean> deleteReportDocumentFileList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
reportDocumentFileService.deleteReportDocumentFileListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得检测报告附件")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:query')")
|
||||||
|
public CommonResult<ReportDocumentFileRespVO> getReportDocumentFile(@RequestParam("id") Long id) {
|
||||||
|
ReportDocumentFileDO reportDocumentFile = reportDocumentFileService.getReportDocumentFile(id);
|
||||||
|
return success(BeanUtils.toBean(reportDocumentFile, ReportDocumentFileRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得检测报告附件分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:query')")
|
||||||
|
public CommonResult<PageResult<ReportDocumentFileRespVO>> getReportDocumentFilePage(@Valid ReportDocumentFilePageReqVO pageReqVO) {
|
||||||
|
PageResult<ReportDocumentFileDO> pageResult = reportDocumentFileService.getReportDocumentFilePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ReportDocumentFileRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出检测报告附件 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:report-document-file:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportReportDocumentFileExcel(@Valid ReportDocumentFilePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ReportDocumentFileDO> list = reportDocumentFileService.getReportDocumentFilePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "检测报告附件.xls", "数据", ReportDocumentFileRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ReportDocumentFileRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,26 +14,27 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
|||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
||||||
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
|
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentDataService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentTypeService;
|
||||||
|
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||||
|
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
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 jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
@@ -59,6 +60,19 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
|||||||
@Resource private ReportDocumentDataService reportDocumentDataService;
|
@Resource private ReportDocumentDataService reportDocumentDataService;
|
||||||
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
||||||
@Resource private ConfigUserSignatureService configUserSignatureService;
|
@Resource private ConfigUserSignatureService configUserSignatureService;
|
||||||
|
@Resource private DataTemplateService dataTemplateService;
|
||||||
|
|
||||||
|
@RequestMapping("/testAsyncTask")
|
||||||
|
public CommonResult<String> testAsyncTask(@RequestParam Long id) {
|
||||||
|
ReportDocumentMainSaveReqVO reqVO = new ReportDocumentMainSaveReqVO();
|
||||||
|
reqVO.setId(id);
|
||||||
|
reqVO.setFlowStatus("async");
|
||||||
|
reportDocumentMainService.updateReportDocumentMain(reqVO);
|
||||||
|
|
||||||
|
reportDocumentMainService.testAsyncTask(id);
|
||||||
|
return CommonResult.success("success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建检测报告")
|
@Operation(summary = "创建检测报告")
|
||||||
@@ -78,6 +92,11 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
|||||||
if(typeDO == null){
|
if(typeDO == null){
|
||||||
return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试");
|
return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "报告类型不存在,请刷新后重试");
|
||||||
}
|
}
|
||||||
|
String dataTemplateKey = typeDO.getReportKey();
|
||||||
|
DataTemplateDO dataTemplateDO = dataTemplateService.getLatestDataByKey(dataTemplateKey);
|
||||||
|
if(dataTemplateDO == null)
|
||||||
|
return error(REPORT_DOCUMENT_TYPE_NOT_EXISTS, "表单编辑器模板不存在,请联系管理员处理");
|
||||||
|
vo.setDataTemplateId(dataTemplateDO.getId());
|
||||||
vo.setDocumentTitle(typeDO.getName());
|
vo.setDocumentTitle(typeDO.getName());
|
||||||
vo.setFlowKey(typeDO.getFlowKey());
|
vo.setFlowKey(typeDO.getFlowKey());
|
||||||
vo.setDocumentType(typeDO.getDocumentType());
|
vo.setDocumentType(typeDO.getDocumentType());
|
||||||
@@ -189,58 +208,32 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
|||||||
|
|
||||||
//处理抬头数据
|
//处理抬头数据
|
||||||
|
|
||||||
if("true".equals(editFlag)){
|
// if("true".equals(editFlag)){
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String formData = vo.getFormData();
|
// String formData = vo.getFormData();
|
||||||
JSONObject formDataJson = new JSONObject();
|
// JSONObject formDataJson = new JSONObject();
|
||||||
if(!ObjectUtils.isEmpty(formData))
|
// if(!ObjectUtils.isEmpty(formData))
|
||||||
formDataJson = JSONObject.parseObject(formData);
|
// formDataJson = JSONObject.parseObject(formData);
|
||||||
List<ReportDocumentDataDO> dataList = reportDocumentDataService.listByMainDataId(id).getData();
|
// List<ReportDocumentDataDO> dataList = reportDocumentDataService.listByMainDataId(id).getData();
|
||||||
ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMain.getReportDocumentTypeId());
|
// ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMain.getReportDocumentTypeId());
|
||||||
String customConfig = typeDO.getCustomConfig();
|
// String customConfig = typeDO.getCustomConfig();
|
||||||
String defaultConclusion = "";
|
// String defaultConclusion = "";
|
||||||
if(!ObjectUtils.isEmpty(customConfig)){
|
// if(!ObjectUtils.isEmpty(customConfig)){
|
||||||
JSONObject config = JSONObject.parseObject(customConfig);
|
// JSONObject config = JSONObject.parseObject(customConfig);
|
||||||
defaultConclusion = config.getString("defaultConclusion");
|
// defaultConclusion = config.getString("defaultConclusion");
|
||||||
}
|
// }
|
||||||
formDataJson.put("conclusion", defaultConclusion);
|
// formDataJson.put("conclusion", defaultConclusion);
|
||||||
if(!dataList.isEmpty())
|
// if(!dataList.isEmpty())
|
||||||
formDataJson.put("sampleName", dataList.get(0).getSampleName());
|
// formDataJson.put("sampleName", dataList.get(0).getSampleName());
|
||||||
//处理检测标准
|
// //处理检测标准
|
||||||
String standard = assembleStandard(dataList);
|
// String standard = assembleStandard(dataList);
|
||||||
formDataJson.put("standard", standard);
|
// formDataJson.put("standard", standard);
|
||||||
formDataJson.put("reportTime", sdf.format(new Date()));
|
// formDataJson.put("reportTime", sdf.format(new Date()));
|
||||||
vo.setFormData(formDataJson.toJSONString());
|
// vo.setFormData(formDataJson.toJSONString());
|
||||||
// ReportDocumentMainSaveReqVO updateVO = new ReportDocumentMainSaveReqVO();
|
// }
|
||||||
// updateVO.setId(reportDocumentMain.getId());
|
|
||||||
// updateVO.setFormData(formDataJson.toJSONString());
|
|
||||||
// reportDocumentMainService.updateReportDocumentMain(updateVO);
|
|
||||||
}
|
|
||||||
return success(vo);
|
return success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String assembleStandard(List<ReportDocumentDataDO> dataList){
|
|
||||||
|
|
||||||
Set<String> standardSet = new HashSet<>();
|
|
||||||
for(ReportDocumentDataDO data : dataList){
|
|
||||||
String content = data.getDocumentContent();
|
|
||||||
if(ObjectUtils.isEmpty( content))
|
|
||||||
continue;
|
|
||||||
JSONObject json = JSONObject.parseObject(content);
|
|
||||||
for(String key : json.keySet()){
|
|
||||||
JSONObject obj = json.getJSONObject(key);
|
|
||||||
String methodName = obj.getString("methodName");
|
|
||||||
if(ObjectUtils.isEmpty(methodName))
|
|
||||||
continue;
|
|
||||||
standardSet.add(methodName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(standardSet.isEmpty())
|
|
||||||
return "";
|
|
||||||
return String.join(",", standardSet);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得检测报告业务分页")
|
@Operation(summary = "获得检测报告业务分页")
|
||||||
//@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')")
|
//@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')")
|
||||||
@@ -261,4 +254,23 @@ public class ReportDocumentMainController extends AbstractFileUploadController i
|
|||||||
ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, list);
|
ExcelUtils.write(response, "检测报告业务.xls", "数据", ReportDocumentMainRespVO.class, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/testCreateIworkWorkflow")
|
||||||
|
@Operation(summary = "测试发起iwork流程")
|
||||||
|
//@PreAuthorize("@ss.hasPermission('qms:report-document-main:query')")
|
||||||
|
public CommonResult<IWorkOperationRespDTO> createIworkWorkflow() {
|
||||||
|
IWorkWorkflowCreateReqDTO req = new IWorkWorkflowCreateReqDTO();
|
||||||
|
req.setJbr("1001");
|
||||||
|
req.setYybm("2001");
|
||||||
|
req.setFb("3001");
|
||||||
|
req.setSqsj("2025-01-01");
|
||||||
|
req.setYyqx("对外邮寄");
|
||||||
|
// req.setYyfkUrl("https://files.example.com/evidence.pdf");
|
||||||
|
req.setYysy("与客户合同用印");
|
||||||
|
req.setXyywjUrl("http://172.16.46.63:30002/yudao/20251204/%E6%B5%8B%E8%AF%95pdf_1764818842846.pdf?response-cache-control=no-cache%2C%20no-store%2C%20must-revalidate&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20251209T093343Z&X-Amz-SignedHeaders=host&X-Amz-Credential=EKplIEnbNgfYBAZbEJNa%2F20251209%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Expires=86400&X-Amz-Signature=37d63249667ea855f9a51bdf47bbb044d5860c302721f52fff2ba644985bae4c");
|
||||||
|
req.setYysx("检测报告用印");
|
||||||
|
req.setYwxtdjbh("JY-20251209-0001");
|
||||||
|
// CommonResult<IWorkOperationRespDTO> ret = reportDocumentMainService.createIWorkflow(req);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -43,4 +43,16 @@ public class ReportDocumentDataPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "样品大类名称")
|
@Schema(description = "样品大类名称")
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型key")
|
||||||
|
private String sampleTypeKey;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品名称")
|
||||||
|
private String entrustSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品编号")
|
||||||
|
private String entrustSampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,22 @@ public class ReportDocumentDataRespVO {
|
|||||||
@ExcelProperty("样品大类名称")
|
@ExcelProperty("样品大类名称")
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型key")
|
||||||
|
@ExcelProperty("样品类型key")
|
||||||
|
private String sampleTypeKey;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品名称")
|
||||||
|
@ExcelProperty("委托样品名称")
|
||||||
|
private String entrustSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品编号")
|
||||||
|
@ExcelProperty("委托样品编号")
|
||||||
|
private String entrustSampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
//==================扩展字段===========
|
//==================扩展字段===========
|
||||||
|
|
||||||
@Schema(description = "样品创建时间")
|
@Schema(description = "样品创建时间")
|
||||||
|
|||||||
@@ -40,4 +40,16 @@ public class ReportDocumentDataSaveReqVO {
|
|||||||
@Schema(description = "样品大类名称")
|
@Schema(description = "样品大类名称")
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型key")
|
||||||
|
private String sampleTypeKey;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品名称")
|
||||||
|
private String entrustSampleName;
|
||||||
|
|
||||||
|
@Schema(description = "委托样品编号")
|
||||||
|
private String entrustSampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
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 ReportDocumentFilePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "报告id", example = "20899")
|
||||||
|
private Long mainId;
|
||||||
|
|
||||||
|
@Schema(description = "文件表ID", example = "25498")
|
||||||
|
private Long fileId;
|
||||||
|
|
||||||
|
@Schema(description = "文件名称", example = "李四")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "文件类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@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,58 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 检测报告附件 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ReportDocumentFileRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698")
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "报告id", example = "20899")
|
||||||
|
@ExcelProperty("报告id")
|
||||||
|
private Long mainId;
|
||||||
|
|
||||||
|
@Schema(description = "文件表ID", example = "25498")
|
||||||
|
@ExcelProperty("文件表ID")
|
||||||
|
private Long fileId;
|
||||||
|
|
||||||
|
@Schema(description = "文件名称", example = "李四")
|
||||||
|
@ExcelProperty("文件名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "路径")
|
||||||
|
@ExcelProperty("路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("文件地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "文件类型", example = "1")
|
||||||
|
@ExcelProperty("文件类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
@ExcelProperty("版本")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 检测报告附件新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ReportDocumentFileSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29698")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "报告id", example = "20899")
|
||||||
|
private Long mainId;
|
||||||
|
|
||||||
|
@Schema(description = "文件表ID", example = "25498")
|
||||||
|
private Long fileId;
|
||||||
|
|
||||||
|
@Schema(description = "文件名称", example = "李四")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@Schema(description = "文件地址", example = "https://www.iocoder.cn")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(description = "文件类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -88,4 +88,10 @@ public class ReportDocumentMainPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "表单设计器模板id")
|
@Schema(description = "表单设计器模板id")
|
||||||
private Long dataTemplateId;
|
private Long dataTemplateId;
|
||||||
|
|
||||||
|
@Schema(description = "附件版本")
|
||||||
|
private Integer documentVersion;
|
||||||
|
|
||||||
|
@Schema(description = "异步执行状态")
|
||||||
|
private String executionStatus;
|
||||||
}
|
}
|
||||||
@@ -115,6 +115,13 @@ public class ReportDocumentMainRespVO {
|
|||||||
@ExcelProperty("表单设计器模板id")
|
@ExcelProperty("表单设计器模板id")
|
||||||
private Long dataTemplateId;
|
private Long dataTemplateId;
|
||||||
|
|
||||||
|
@Schema(description = "附件版本")
|
||||||
|
@ExcelProperty("附件版本")
|
||||||
|
private Integer documentVersion;
|
||||||
|
|
||||||
|
@Schema(description = "异步执行状态")
|
||||||
|
@ExcelProperty("异步执行状态")
|
||||||
|
private String executionStatus;
|
||||||
//==============================扩展字段=======================================
|
//==============================扩展字段=======================================
|
||||||
@Schema(description = "记录数")
|
@Schema(description = "记录数")
|
||||||
@ExcelProperty("记录数")
|
@ExcelProperty("记录数")
|
||||||
|
|||||||
@@ -90,6 +90,11 @@ public class ReportDocumentMainSaveReqVO {
|
|||||||
@Schema(description = "表单设计器模板id")
|
@Schema(description = "表单设计器模板id")
|
||||||
private Long dataTemplateId;
|
private Long dataTemplateId;
|
||||||
|
|
||||||
|
@Schema(description = "附件版本")
|
||||||
|
private Integer documentVersion;
|
||||||
|
|
||||||
|
@Schema(description = "异步执行状态")
|
||||||
|
private String executionStatus;
|
||||||
|
|
||||||
//====================附加属性==============================
|
//====================附加属性==============================
|
||||||
@Schema(description = "委托id,支持多值")
|
@Schema(description = "委托id,支持多值")
|
||||||
|
|||||||
@@ -75,8 +75,26 @@ public class ReportDocumentDataDO extends BusinessBaseDO {
|
|||||||
@TableField("BSE_SMP_NAME")
|
@TableField("BSE_SMP_NAME")
|
||||||
private String baseSampleName;
|
private String baseSampleName;
|
||||||
|
|
||||||
|
//样品类型key
|
||||||
|
@TableField("SMP_TP_KY")
|
||||||
|
private String sampleTypeKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委托样品名称
|
||||||
|
*/
|
||||||
|
@TableField("ENTT_SMP_NAME")
|
||||||
|
private String entrustSampleName;
|
||||||
|
/**
|
||||||
|
* 委托样品编号
|
||||||
|
*/
|
||||||
|
@TableField("ENTT_SMP_CD")
|
||||||
|
private String entrustSampleCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@TableField("SRT")
|
||||||
|
private Integer sort;
|
||||||
//==================扩展字段===========
|
//==================扩展字段===========
|
||||||
|
|
||||||
//样品创建时间
|
//样品创建时间
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 检测报告附件 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("t_rpt_doc_file")
|
||||||
|
@KeySequence("t_rpt_doc_file_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ReportDocumentFileDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 报告id
|
||||||
|
*/
|
||||||
|
@TableField("MAIN_ID")
|
||||||
|
private Long mainId;
|
||||||
|
/**
|
||||||
|
* 文件表ID
|
||||||
|
*/
|
||||||
|
@TableField("FILE_ID")
|
||||||
|
private Long fileId;
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 路径
|
||||||
|
*/
|
||||||
|
@TableField("PATH")
|
||||||
|
private String path;
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
@TableField("URL")
|
||||||
|
private String url;
|
||||||
|
/**
|
||||||
|
* 文件类型
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
@TableField("VER")
|
||||||
|
private Integer version;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -141,4 +141,12 @@ public class ReportDocumentMainDO extends BusinessBaseDO {
|
|||||||
//表单设计器模板id
|
//表单设计器模板id
|
||||||
@TableField("DAT_TMPL_ID")
|
@TableField("DAT_TMPL_ID")
|
||||||
private Long dataTemplateId;
|
private Long dataTemplateId;
|
||||||
|
|
||||||
|
//表单设计器模板id
|
||||||
|
@TableField("DOC_VER")
|
||||||
|
private Integer documentVersion;
|
||||||
|
|
||||||
|
//异步执行状态
|
||||||
|
@TableField("EXC_STS")
|
||||||
|
private String executionStatus;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.dal.mapper;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告附件 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ReportDocumentFileMapper extends BaseMapperX<ReportDocumentFileDO> {
|
||||||
|
|
||||||
|
default PageResult<ReportDocumentFileDO> selectPage(ReportDocumentFilePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ReportDocumentFileDO>()
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getMainId, reqVO.getMainId())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getFileId, reqVO.getFileId())
|
||||||
|
.likeIfPresent(ReportDocumentFileDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getPath, reqVO.getPath())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getUrl, reqVO.getUrl())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getVersion, reqVO.getVersion())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.betweenIfPresent(ReportDocumentFileDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(ReportDocumentFileDO::getRemark, reqVO.getRemark())
|
||||||
|
.orderByDesc(ReportDocumentFileDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.service;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.zt.plat.framework.common.exception.ServiceException;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.module.infra.api.file.FileApi;
|
||||||
|
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
||||||
|
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||||
|
import com.zt.plat.module.qms.common.data.dal.dataobject.DataTemplateDO;
|
||||||
|
import com.zt.plat.module.qms.common.data.service.DataTemplateService;
|
||||||
|
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
||||||
|
import com.zt.plat.module.system.api.iwork.IWorkIntegrationApi;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.compress.utils.IOUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_FILE_NOT_EXISTS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 处理报告附件和发起iwork流程
|
||||||
|
* */
|
||||||
|
@Service("reportDocumentAssistService")
|
||||||
|
@Slf4j
|
||||||
|
public class ReportDocumentAssistService {
|
||||||
|
@Resource
|
||||||
|
private IWorkIntegrationApi iWorkIntegrationApi;
|
||||||
|
|
||||||
|
@Value("${zzjc.html2pdf.addr:}")
|
||||||
|
private String html2pdfAddr;
|
||||||
|
|
||||||
|
@Resource private ReportDocumentDataService reportDocumentDataService;
|
||||||
|
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
||||||
|
@Resource private ReportDocumentFileService reportDocumentFileService;
|
||||||
|
@Resource private DataTemplateService dataTemplateService;
|
||||||
|
@Resource private SequenceUtil sequenceUtil;
|
||||||
|
@Resource private FileApi fileApi;
|
||||||
|
|
||||||
|
private String sequenceKey = "QMS_REPORT_IWORK_CODE";
|
||||||
|
|
||||||
|
// todo 判断是否更新pdf
|
||||||
|
public boolean checkUpdateDocFile(JSONObject variables){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 更新报告附件,并发起iwork流程*/
|
||||||
|
public void updateDocFileAndCreateIWorkflow(JSONObject variables, ReportDocumentMainDO entity) throws IOException {
|
||||||
|
// boolean updateDocFileFlag = true;
|
||||||
|
boolean createIworkWorkflowFlag = false;
|
||||||
|
JSONArray bpmFieldExtensions = variables.getJSONArray("bpmFieldExtensions");
|
||||||
|
if(bpmFieldExtensions == null)
|
||||||
|
bpmFieldExtensions = new JSONArray();
|
||||||
|
for(int i = 0; i < bpmFieldExtensions.size(); i++){
|
||||||
|
JSONObject extension = bpmFieldExtensions.getJSONObject(i);
|
||||||
|
String fieldName = extension.getString("fieldName");
|
||||||
|
String stringValue = extension.getString("stringValue");
|
||||||
|
if(fieldName.equalsIgnoreCase("createiworkflow") && stringValue.equals("1")){
|
||||||
|
createIworkWorkflowFlag = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ReportDocumentFileDO docFile = generatePdf(entity);
|
||||||
|
if(createIworkWorkflowFlag){
|
||||||
|
createIWorkflow(entity, docFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 发起iwork用印*/
|
||||||
|
public CommonResult<IWorkOperationRespDTO> createIWorkflow(ReportDocumentMainDO entity, ReportDocumentFileDO docFile) {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
IWorkWorkflowCreateReqDTO dto = new IWorkWorkflowCreateReqDTO();
|
||||||
|
dto.setJbr(String.valueOf(loginUser.getId()));
|
||||||
|
dto.setYybm(String.valueOf(loginUser.getVisitDeptId()));
|
||||||
|
dto.setFb(String.valueOf(loginUser.getVisitCompanyId()));
|
||||||
|
dto.setSqsj(sdf.format(new Date()));
|
||||||
|
dto.setYyqx("检测报告用印");
|
||||||
|
dto.setYysy("检测报告用印");
|
||||||
|
dto.setYysx("检测报告用印");
|
||||||
|
dto.setXyywjUrl(docFile.getUrl());
|
||||||
|
dto.setYwxtdjbh(sequenceUtil.genCode(sequenceKey));
|
||||||
|
return iWorkIntegrationApi.createWorkflow(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 生成新版pdf文件
|
||||||
|
* 在reportDocumentFile创建新pdf文件
|
||||||
|
* */
|
||||||
|
public ReportDocumentFileDO generatePdf(ReportDocumentMainDO mainDO) throws IOException {
|
||||||
|
String pageFlag = "1"; //分页处理
|
||||||
|
Long typeId = mainDO.getReportDocumentTypeId();
|
||||||
|
ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(typeId);
|
||||||
|
DataTemplateDO templateDO = dataTemplateService.getDataTemplate(mainDO.getDataTemplateId());
|
||||||
|
CommonResult<JSONArray> result = reportDocumentDataService.assembleDynamicData(mainDO, typeDO, pageFlag);
|
||||||
|
JSONArray data = result.getData();
|
||||||
|
String templateContent = templateDO.getFormContent();
|
||||||
|
JSONObject templateData = new JSONObject();
|
||||||
|
JSONArray tableList = data.getJSONArray(0);
|
||||||
|
templateData.put("headerData", tableList.getJSONObject(0).clone());
|
||||||
|
templateData.put("tableList", tableList);
|
||||||
|
templateData.put("formData", mainDO.getFormData());
|
||||||
|
templateData.put("signatureData", mainDO.getDocumentSignature());
|
||||||
|
|
||||||
|
JSONObject bodyJson = new JSONObject();
|
||||||
|
bodyJson.put("Template", templateContent);
|
||||||
|
bodyJson.put("Data", templateData.toJSONString());
|
||||||
|
String bodyStr = bodyJson.toJSONString();
|
||||||
|
log.info("html2pdf body: " + bodyStr);
|
||||||
|
log.info("html2pdf--start at {}", LocalDateTime.now());
|
||||||
|
HttpResponse response = HttpUtil.createPost(html2pdfAddr)
|
||||||
|
.body(bodyStr)
|
||||||
|
.timeout(15000)
|
||||||
|
.execute();
|
||||||
|
log.info("html2pdf--end at {}", LocalDateTime.now());
|
||||||
|
InputStream inputStream = response.bodyStream(); // 关键:返回原始 InputStream
|
||||||
|
|
||||||
|
//尝试从响应头中提取文件名
|
||||||
|
// String contentDisposition = response.header("Content-Disposition");
|
||||||
|
String documentCode = mainDO.getDocumentCode();
|
||||||
|
if(documentCode == null) documentCode = "";
|
||||||
|
String filename = documentCode + "检测报告.pdf";
|
||||||
|
// String filename = extractFilename(contentDisposition).orElse(defaultName);
|
||||||
|
//inputStream转byte[]
|
||||||
|
byte[] fileBytes = IOUtils.toByteArray(inputStream);
|
||||||
|
|
||||||
|
//上传到文件服务
|
||||||
|
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
||||||
|
fileCreateReqDTO.setName(filename);
|
||||||
|
fileCreateReqDTO.setDirectory(null);
|
||||||
|
fileCreateReqDTO.setType(null);
|
||||||
|
fileCreateReqDTO.setContent(fileBytes);
|
||||||
|
CommonResult<FileRespDTO> fileResult = fileApi.createFileWithReturn(fileCreateReqDTO);
|
||||||
|
if (fileResult == null || !fileResult.isSuccess() || fileResult.getData() == null) {
|
||||||
|
throw new ServiceException(REPORT_DOCUMENT_FILE_NOT_EXISTS.getCode(), "通过文件服务创建附件失败: " + Optional.ofNullable(fileResult).map(CommonResult::getMsg).orElse("未知错误"));
|
||||||
|
}
|
||||||
|
FileRespDTO fileRespDTO = fileResult.getData();
|
||||||
|
//写入ReportDocumentFile
|
||||||
|
ReportDocumentFileSaveReqVO fileSaveReqVO = new ReportDocumentFileSaveReqVO();
|
||||||
|
fileSaveReqVO.setMainId(mainDO.getId());
|
||||||
|
fileSaveReqVO.setFileId(fileRespDTO.getId());
|
||||||
|
fileSaveReqVO.setName(filename);
|
||||||
|
fileSaveReqVO.setPath(fileRespDTO.getDirectory());
|
||||||
|
fileSaveReqVO.setUrl(fileRespDTO.getUrl());
|
||||||
|
fileSaveReqVO.setVersion(mainDO.getDocumentVersion());
|
||||||
|
reportDocumentFileService.createReportDocumentFile(fileSaveReqVO);
|
||||||
|
return BeanUtils.toBean(fileRespDTO, ReportDocumentFileDO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// private Optional<String> extractFilename(String contentDisposition) {
|
||||||
|
// if (contentDisposition != null && contentDisposition.contains("filename=")) {
|
||||||
|
// String filename = contentDisposition.substring(contentDisposition.indexOf("filename=") + 9);
|
||||||
|
// filename = filename.replaceAll("\"", "").trim();
|
||||||
|
// return Optional.of(filename);
|
||||||
|
// }
|
||||||
|
// return Optional.empty();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// private String encodeFilename(String filename) {
|
||||||
|
// try {
|
||||||
|
// return URLEncoder.encode(filename, StandardCharsets.UTF_8.toString())
|
||||||
|
// .replaceAll("\\+", "%20");
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// return "download.bin";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface ReportDocumentDataService {
|
public interface ReportDocumentDataService {
|
||||||
|
|
||||||
CommonResult<List<JSONObject>> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig);
|
CommonResult<JSONArray> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO reportConfig, String pageFlag);
|
||||||
|
|
||||||
CommonResult<List<ReportDocumentDataDO>> listByMainDataId(Long mainDataId);
|
CommonResult<List<ReportDocumentDataDO>> listByMainDataId(Long mainDataId);
|
||||||
CommonResult<Long> countMainDataId(Long mainDataId);
|
CommonResult<Long> countMainDataId(Long mainDataId);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.e
|
|||||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_DATA_NOT_EXISTS;
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_DATA_NOT_EXISTS;
|
||||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS;
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.REPORT_DOCUMENT_TYPE_NOT_EXISTS;
|
||||||
import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_DYNAMIC;
|
import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_DYNAMIC;
|
||||||
|
import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_CALCULATED;
|
||||||
import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_FIXED;
|
import static com.zt.plat.module.qms.enums.QmsCommonConstant.FIELD_FIXED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,10 +44,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
private final String colPrefix = "col";
|
private final String colPrefix = "col";
|
||||||
private final String sampleCodeKey = "SMP_CD";
|
private final String sampleCodeKey = "SMP_CD";
|
||||||
private final String sampleNameKey = "SMP_NAME";
|
private final String sampleNameKey = "SMP_NAME";
|
||||||
private final String name_code_merge = "merge";
|
private final String sampleNameAndCodeKey = "SMP_NAME_CD";
|
||||||
private final String name_code_name = "name";
|
private final String entrustSampleNameKey = "ENTT_SMP_NAME";
|
||||||
private final String name_code_code = "code";
|
private final String entrustSampleCodeKey = "ENTT_SMP_CD";
|
||||||
private final String name_code_split = "split";
|
private final String entrustSampleNameCodeKey = "ENTT_SMP_NAME_CD";
|
||||||
|
private final String rowTypeKey = "rowType"; //行类型
|
||||||
|
private final String rowTypeTitle = "title"; //行类型-标题
|
||||||
|
private final String rowTypeLimit = "limit"; //行类型-检出限
|
||||||
private final String rangeKey = "minLimitValue";
|
private final String rangeKey = "minLimitValue";
|
||||||
private final String emptyText = "以下为空白";
|
private final String emptyText = "以下为空白";
|
||||||
|
|
||||||
@@ -55,10 +59,16 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
* 组装动态报表数据
|
* 组装动态报表数据
|
||||||
* */
|
* */
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<List<JSONObject>> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO typeDO) {
|
public CommonResult<JSONArray> assembleDynamicData(ReportDocumentMainDO mainData, ReportDocumentTypeDO typeDO, String pageFlag) {
|
||||||
if(typeDO == null || typeDO.getConfigReportTypeId() == null)
|
if(typeDO == null || typeDO.getConfigReportTypeId() == null)
|
||||||
return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "报告配置为空,或未配置报表类型,请联系管理员处理!");
|
return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "报告配置为空,或未配置报表类型,请联系管理员处理!");
|
||||||
String customConfig = typeDO.getCustomConfig();
|
String customConfig = typeDO.getCustomConfig();
|
||||||
|
JSONObject configJson = JSONObject.parseObject(customConfig);
|
||||||
|
String verticalFlag = configJson.getString("verticalFlag");
|
||||||
|
String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数
|
||||||
|
Integer maxRowCount = 3;
|
||||||
|
if(!ObjectUtils.isEmpty(maxRowCountStr))
|
||||||
|
maxRowCount = Integer.parseInt(maxRowCountStr);
|
||||||
//查询报表字段配置
|
//查询报表字段配置
|
||||||
ConfigReportFieldPageReqVO fieldParam = new ConfigReportFieldPageReqVO();
|
ConfigReportFieldPageReqVO fieldParam = new ConfigReportFieldPageReqVO();
|
||||||
fieldParam.setConfigReportTypeId(typeDO.getConfigReportTypeId());
|
fieldParam.setConfigReportTypeId(typeDO.getConfigReportTypeId());
|
||||||
@@ -67,38 +77,167 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
if(fieldListAll.isEmpty())
|
if(fieldListAll.isEmpty())
|
||||||
return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "未配置报表字段,请联系管理员处理!");
|
return CommonResult.error(REPORT_DOCUMENT_TYPE_NOT_EXISTS.getCode(), "未配置报表字段,请联系管理员处理!");
|
||||||
List<ReportDocumentDataDO> dataList = listByMainDataId(mainData.getId()).getData();
|
List<ReportDocumentDataDO> dataList = listByMainDataId(mainData.getId()).getData();
|
||||||
//处理字段,提取有数据的字段
|
|
||||||
List<ConfigReportFieldDO> fieldList = new ArrayList<>();
|
//拆分dataList,按样品分类key拆分
|
||||||
List<String> hasFields = new ArrayList<>();
|
List<List<ReportDocumentDataDO>> dataListGroup = new ArrayList<>();
|
||||||
for(ConfigReportFieldDO fieldDO : fieldListAll){
|
String[] sampleTypeKeys = new String[]{"inspectionAnalysisSample", "comprehensiveInspectionSample"}; //商检分析样、商检综合样
|
||||||
String field = fieldDO.getField();
|
for(String sampleTypeKey : sampleTypeKeys){
|
||||||
String fieldName = fieldDO.getFieldName();
|
List<ReportDocumentDataDO> dataListByKey = new ArrayList<>();
|
||||||
String fieldType = fieldDO.getFieldType();
|
for(ReportDocumentDataDO dataDO: dataList){
|
||||||
//先处理固定列
|
if(sampleTypeKey.equals(dataDO.getSampleTypeKey())){
|
||||||
if(FIELD_FIXED.equals(fieldType)){
|
dataListByKey.add(dataDO);
|
||||||
if(!hasFields.contains( field)){
|
|
||||||
fieldList.add(fieldDO);
|
|
||||||
hasFields.add(field);
|
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
for(ReportDocumentDataDO dataDO : dataList){
|
if(!dataListByKey.isEmpty())
|
||||||
String documentContent = dataDO.getDocumentContent();
|
dataListGroup.add(dataListByKey);
|
||||||
JSONObject dataJson = JSONObject.parseObject(documentContent);
|
}
|
||||||
if(dataJson == null)
|
if(dataListGroup.isEmpty())
|
||||||
continue;
|
dataListGroup.add(dataList);
|
||||||
if(dataJson.containsKey(field)){
|
JSONArray rowList = new JSONArray();
|
||||||
if(!hasFields.contains( fieldName)){
|
for(int i = 0; i < dataListGroup.size(); i++){
|
||||||
|
List<ReportDocumentDataDO> dataListByKey = dataListGroup.get(i);
|
||||||
|
//处理字段,提取有数据的字段
|
||||||
|
List<ConfigReportFieldDO> fieldList = new ArrayList<>();
|
||||||
|
List<String> hasFields = new ArrayList<>();
|
||||||
|
for(ConfigReportFieldDO fieldDO : fieldListAll){
|
||||||
|
String field = fieldDO.getField();
|
||||||
|
String fieldName = fieldDO.getFieldName();
|
||||||
|
String fieldType = fieldDO.getFieldType();
|
||||||
|
//先处理固定列
|
||||||
|
if(FIELD_FIXED.equals(fieldType)){
|
||||||
|
if(!hasFields.contains( field)){
|
||||||
fieldList.add(fieldDO);
|
fieldList.add(fieldDO);
|
||||||
hasFields.add(fieldName);
|
hasFields.add(field);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for(ReportDocumentDataDO dataDO : dataListByKey){
|
||||||
|
String documentContent = dataDO.getDocumentContent();
|
||||||
|
JSONObject dataJson = JSONObject.parseObject(documentContent);
|
||||||
|
if(dataJson == null)
|
||||||
|
continue;
|
||||||
|
if(dataJson.containsKey(field)){
|
||||||
|
if(!hasFields.contains( fieldName)){
|
||||||
|
fieldList.add(fieldDO);
|
||||||
|
hasFields.add(fieldName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
assembleStep1(rowList, fieldList, dataListByKey, customConfig, i); //处理后的组数对象
|
||||||
|
}
|
||||||
|
if(!"1".equals(verticalFlag)){
|
||||||
|
//处理空数据,填充/
|
||||||
|
rowList = assembleEmpty(configJson, rowList);
|
||||||
|
|
||||||
|
//处理数据分页
|
||||||
|
if("1".equals(pageFlag)){
|
||||||
|
JSONArray pageRowList = assemblePageRowList(rowList, configJson);
|
||||||
|
return CommonResult.success(pageRowList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//以下为空白
|
||||||
|
if(rowList.size() < maxRowCount){
|
||||||
|
JSONObject t = new JSONObject();
|
||||||
|
t.put(colPrefix + "01", emptyText);
|
||||||
|
rowList.add(t.clone());
|
||||||
|
}
|
||||||
|
while(rowList.size() < maxRowCount){
|
||||||
|
JSONObject t = new JSONObject();
|
||||||
|
t.put(colPrefix + "01", " ");
|
||||||
|
rowList.add(t.clone());
|
||||||
|
}
|
||||||
|
return CommonResult.success(rowList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 处理分页
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
private JSONArray assemblePageRowList(JSONArray rowList, JSONObject configJson){
|
||||||
|
JSONArray pageRowList = new JSONArray();
|
||||||
|
Integer maxRowCount = 20;
|
||||||
|
String maxRowCountStr = configJson.getString("maxRowCount"); //最大行数
|
||||||
|
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
||||||
|
int rowLength = rowList.size();
|
||||||
|
if(rowLength <= maxRowCount){
|
||||||
|
pageRowList.add(rowList);
|
||||||
|
return pageRowList;
|
||||||
|
}
|
||||||
|
JSONArray remainingRows = new JSONArray();
|
||||||
|
remainingRows.addAll(rowList);
|
||||||
|
while(remainingRows.size() > 0){
|
||||||
|
JSONArray pageRow = new JSONArray();
|
||||||
|
for(int i = 0; i < maxRowCount ; i++){
|
||||||
|
if(remainingRows.isEmpty())
|
||||||
|
break;
|
||||||
|
pageRow.add(remainingRows.getJSONObject(0));
|
||||||
|
remainingRows.remove(0);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
在每页开头插入“标题行”
|
||||||
|
如果最后一行是标题,直接移到下一页;如果不是,往上寻找最近的“标题行”
|
||||||
|
*/
|
||||||
|
JSONObject lastTitleRow = pageRow.getJSONObject(pageRow.size() - 1);
|
||||||
|
String rowType = lastTitleRow.getString(rowTypeKey);
|
||||||
|
if(rowTypeTitle.equals(rowType)){
|
||||||
|
//如果最后一行是“标题行”,移除
|
||||||
|
pageRow.remove(pageRow.size() - 1);
|
||||||
|
}else {
|
||||||
|
for(int i = pageRow.size() - 1; i >= 0; i--){
|
||||||
|
JSONObject t = pageRow.getJSONObject(i);
|
||||||
|
rowType = t.getString(rowTypeKey);
|
||||||
|
if(rowTypeTitle.equals(rowType)){
|
||||||
|
lastTitleRow = t;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!remainingRows.isEmpty()){
|
||||||
|
JSONObject firstRemainingRow = remainingRows.getJSONObject(0);
|
||||||
|
if(!rowTypeTitle.equals(firstRemainingRow.getString(rowTypeKey))){
|
||||||
|
remainingRows.add(0, lastTitleRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pageRowList.add(pageRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
//组装数据
|
//在最后一页插入“以下为空”
|
||||||
List<JSONObject> step1Arr = assembleStep1(fieldList, dataList, customConfig); //处理后的组数对象
|
JSONArray pageRow = pageRowList.getJSONArray(pageRowList.size() - 1);
|
||||||
return CommonResult.success(step1Arr);
|
if(pageRow.size() < maxRowCount){
|
||||||
|
JSONObject t = new JSONObject();
|
||||||
|
t.put(colPrefix + "01", emptyText);
|
||||||
|
pageRow.add(t.clone());
|
||||||
|
}
|
||||||
|
return pageRowList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONArray assembleEmpty(JSONObject configJson, JSONArray rowList){
|
||||||
|
JSONArray fixedCol = configJson.getJSONArray("fixedCol"); //固定列,举例:["SMP_NAME", "SMP_CD"]
|
||||||
|
if(fixedCol == null) fixedCol = new JSONArray();
|
||||||
|
JSONArray fixedColRight = configJson.getJSONArray("fixedColRight"); //右侧固定列
|
||||||
|
if(fixedColRight == null) fixedColRight = new JSONArray();
|
||||||
|
String dynamicColCountStr = configJson.getString("dynamicColCount"); //动态列(检测项)数量
|
||||||
|
Integer dynamicColCount = 0;
|
||||||
|
Integer fixedColCount_left = 0;
|
||||||
|
Integer fixedColCount_right = 0;
|
||||||
|
if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr);
|
||||||
|
fixedColCount_left = fixedCol.size();
|
||||||
|
fixedColCount_right = fixedColRight.size();
|
||||||
|
|
||||||
|
for(int i = 0; i < rowList.size(); i++){
|
||||||
|
JSONObject row = rowList.getJSONObject(i);
|
||||||
|
if(" ".equals(row.getString(colPrefix + "01")))
|
||||||
|
continue;
|
||||||
|
int colIndex = 1;
|
||||||
|
while(colIndex <= dynamicColCount){
|
||||||
|
String colKey = colPrefix + parseNumToString(colIndex + fixedColCount_left, 2);
|
||||||
|
if(!row.containsKey(colKey))
|
||||||
|
row.put(colKey, "/");
|
||||||
|
colIndex ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rowList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,130 +245,193 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
* @param fieldList 要显示的字段列表。固定字段在最前
|
* @param fieldList 要显示的字段列表。固定字段在最前
|
||||||
* @param customConfig 报告配置项
|
* @param customConfig 报告配置项
|
||||||
* */
|
* */
|
||||||
private List<JSONObject> assembleStep1(List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig){
|
private JSONArray assembleStep1(JSONArray rowList, List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig, int groupIndex){
|
||||||
if(dataList.isEmpty())
|
if(dataList.isEmpty())
|
||||||
return new ArrayList<>();
|
return new JSONArray();
|
||||||
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
||||||
Integer dynamicColCount = 3;
|
Integer dynamicColCount = 3;
|
||||||
Integer fixedColCount = 0;
|
Integer fixedColCount_left = 0;
|
||||||
Integer maxRowCount = 3;
|
|
||||||
String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量
|
String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量
|
||||||
// String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量
|
JSONArray fixedCol = jsonObject.getJSONArray("fixedCol"); //固定列,举例:["SMP_NAME", "SMP_CD"]
|
||||||
JSONArray fixedCol = jsonObject.getJSONArray("fixedCol"); //固定列,举例:["sampleName", "sampleCode"]
|
if(fixedCol == null) fixedCol = new JSONArray();
|
||||||
JSONArray fixedColShow = jsonObject.getJSONArray("fixedColShow"); //固定列,举例:["产品名称", "编 号"]
|
JSONArray fixedColRight = jsonObject.getJSONArray("fixedColRight"); //右侧固定列
|
||||||
String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数
|
if(fixedColRight == null) fixedColRight = new JSONArray();
|
||||||
// String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示
|
|
||||||
String hasRemark = jsonObject.getString("hasRemark"); //是否有备注
|
String hasRemark = jsonObject.getString("hasRemark"); //是否有备注
|
||||||
String hasRange = jsonObject.getString("hasRange"); //是否有检出限
|
String hasRange = jsonObject.getString("hasRange"); //是否有检出限
|
||||||
String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表
|
String verticalFlag = jsonObject.getString("verticalFlag"); //vertical-纵表, 否则为横表
|
||||||
String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key
|
String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key
|
||||||
if("1".equals(verticalFlag)){ //纵表
|
if("1".equals(verticalFlag)){ //纵表
|
||||||
return assembleVerticalData(fieldList, dataList, customConfig);
|
return assembleVerticalData(rowList, fieldList, dataList, customConfig);
|
||||||
}
|
}
|
||||||
if(!ObjectUtils.isEmpty(fixedFields)){ //固定列
|
if(!ObjectUtils.isEmpty(fixedFields)){ //固定列
|
||||||
return assembleFixedFieldsData(fieldList, dataList, customConfig);
|
return assembleFixedFieldsData(rowList, fieldList, dataList, customConfig);
|
||||||
}
|
}
|
||||||
if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr);
|
if(!ObjectUtils.isEmpty(dynamicColCountStr)) dynamicColCount = Integer.parseInt(dynamicColCountStr);
|
||||||
if(fixedCol != null) fixedColCount = fixedCol.size();
|
fixedColCount_left = fixedCol.size();
|
||||||
|
Integer colCountOneSample = fixedColCount_left + dynamicColCount; //每个样品要占的列数
|
||||||
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
|
||||||
Integer eleCount = 0; //元素数量,即元素列总数
|
|
||||||
|
|
||||||
for(ConfigReportFieldDO fieldDO : fieldList){
|
|
||||||
String fieldType = fieldDO.getFieldType();
|
|
||||||
if(FIELD_DYNAMIC.equals(fieldType))
|
|
||||||
eleCount ++;
|
|
||||||
}
|
|
||||||
Integer rowCountOneSample = eleCount / dynamicColCount + (eleCount % dynamicColCount == 0 ? 0 : 1); //每个样品要占的行数
|
|
||||||
Integer colCountOneSample = fixedColCount + dynamicColCount; //每个样品要占的列数
|
|
||||||
Integer dataLength = dataList.size();
|
|
||||||
Integer emptyRowCount = dataLength < maxRowCount ? 1 : 0; //空行数
|
|
||||||
// Integer allRowCount = 1 + dataLength + emptyRowCount + 1; //标题 + 样品数 + 空行
|
|
||||||
|
|
||||||
if("1".equals(hasRange))
|
|
||||||
emptyRowCount ++;
|
|
||||||
|
|
||||||
// if(rowCountOneSample > 1){
|
|
||||||
// allRowCount = (1 + dataLength + emptyRowCount + 9) * rowCountOneSample + emptyRowCount; //(标题 + 样品数 + 空行) * 但样品行数 + 末尾行
|
|
||||||
// }
|
|
||||||
List<JSONObject> rowList = new ArrayList<>();
|
|
||||||
for(int i = 0; i < maxRowCount; i++){
|
|
||||||
JSONObject row = new JSONObject();
|
|
||||||
row.put("col01", " ");
|
|
||||||
rowList.add( row);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//=============处理表头============
|
//=============处理表头============
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
JSONObject r = new JSONObject(); //检出限
|
JSONObject r = new JSONObject(); //检出限
|
||||||
int rowAssist = 1;
|
|
||||||
int colIndex = fixedColCount + 1;
|
|
||||||
boolean lastObjFlag = true;
|
|
||||||
//取第一行数据,用来处理检出限
|
//取第一行数据,用来处理检出限
|
||||||
JSONObject firstData = new JSONObject(); //取第一行数据,用于处理检出限
|
JSONObject firstData = JSONObject.parseObject(dataList.get(0).getDocumentContent()); //取第一行数据,用于处理检出限
|
||||||
if(dataLength > 0)
|
|
||||||
firstData = JSONObject.parseObject(dataList.get(0).getDocumentContent());
|
|
||||||
if("1".equals(hasRemark)){
|
if("1".equals(hasRemark)){
|
||||||
//在最后一列增加备注
|
//在最后一列增加备注
|
||||||
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注");
|
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注");
|
||||||
}
|
}
|
||||||
for(ConfigReportFieldDO fieldDO : fieldList){
|
//取fieldList的动态字段,并分组
|
||||||
|
List<List<ConfigReportFieldDO>> dynamicFieldListGroup = new ArrayList<>();
|
||||||
|
int fieldIndex = 1;
|
||||||
|
List<ConfigReportFieldDO> list = new ArrayList<>();
|
||||||
|
for(int i = 0; i < fieldList.size(); i++){
|
||||||
|
ConfigReportFieldDO fieldDO = fieldList.get(i);
|
||||||
String fieldType = fieldDO.getFieldType();
|
String fieldType = fieldDO.getFieldType();
|
||||||
String field = fieldDO.getField();
|
if(FIELD_FIXED.equals(fieldType))
|
||||||
if(FIELD_FIXED.equals(fieldType)){ //这里只处理动态列。固定列在 addTitleToRowList 处理
|
|
||||||
continue;
|
continue;
|
||||||
|
list.add(fieldDO);
|
||||||
|
if(fieldIndex % dynamicColCount == 0){
|
||||||
|
dynamicFieldListGroup.add(list);
|
||||||
|
list = new ArrayList<>();
|
||||||
}
|
}
|
||||||
String fieldName = fieldDO.getFieldName();
|
fieldIndex ++;
|
||||||
String colKey = parseNumToString(colIndex, 2);
|
}
|
||||||
t.put(colPrefix + colKey, fieldName);
|
if(!list.isEmpty())
|
||||||
//查询当前字段的检出限
|
dynamicFieldListGroup.add(list);
|
||||||
JSONObject fieldObj = firstData.getJSONObject( field);
|
int colIndex = 1;
|
||||||
String rangeVal = "";
|
for(int i = 0; i < dynamicFieldListGroup.size(); i++){
|
||||||
if(fieldObj != null){
|
List<ConfigReportFieldDO> dynamicFieldList = dynamicFieldListGroup.get(i);
|
||||||
rangeVal = fieldObj.getString(rangeKey);
|
t = new JSONObject();
|
||||||
}
|
t.put(rowTypeKey, rowTypeTitle);
|
||||||
r.put(colPrefix + colKey, rangeVal);
|
r = new JSONObject();
|
||||||
r.put(colPrefix + "01", "方法检出限");
|
r.put(rowTypeKey, rowTypeLimit);
|
||||||
lastObjFlag = true;
|
colIndex = fixedColCount_left + 1; //第二组以后,从固定列数开始
|
||||||
if(colIndex % colCountOneSample == 0){
|
for(ConfigReportFieldDO fieldDO : dynamicFieldList) {
|
||||||
addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList);
|
String field = fieldDO.getField();
|
||||||
if("1".equals(hasRange))
|
String fieldName = fieldDO.getFieldName();
|
||||||
addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList);
|
String colKey = parseNumToString(colIndex, 2);
|
||||||
t = new JSONObject();
|
t.put(colPrefix + colKey, fieldName);
|
||||||
r = new JSONObject();
|
//查询当前字段的检出限
|
||||||
|
JSONObject fieldObj = firstData.getJSONObject(field);
|
||||||
if("1".equals(hasRemark)){
|
String rangeVal = "";
|
||||||
//在最后一列增加备注
|
if (fieldObj != null) {
|
||||||
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注");
|
rangeVal = fieldObj.getString(rangeKey);
|
||||||
}
|
}
|
||||||
rowAssist++;
|
r.put(colPrefix + colKey, rangeVal);
|
||||||
colIndex = fixedColCount + 1; //第二组以后,从固定列数开始
|
r.put(colPrefix + "01", "方法检出限");
|
||||||
lastObjFlag = false;
|
colIndex ++;
|
||||||
continue;
|
}
|
||||||
|
//处理备注列
|
||||||
|
if(i == 0 && groupIndex == 0 && "1".equals(hasRemark)){
|
||||||
|
//在最后一列增加备注
|
||||||
|
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), "备注");
|
||||||
|
}
|
||||||
|
if(i > 0 || groupIndex > 0){ //插入空行
|
||||||
|
JSONObject emptyRow = new JSONObject();
|
||||||
|
emptyRow.put(colPrefix + "01", " ");
|
||||||
|
rowList.add(emptyRow);
|
||||||
|
}
|
||||||
|
addTitleToRowList(fixedCol, fixedColRight, dynamicColCount, t, rowList, fieldList);
|
||||||
|
//插入样品数据
|
||||||
|
addDataToRowList(fixedCol, fixedColRight, dynamicFieldList, dataList, rowList, fixedColCount_left, dynamicColCount, hasRemark);
|
||||||
|
//检出限
|
||||||
|
if("1".equals(hasRange)){
|
||||||
|
rowList.add(r);
|
||||||
}
|
}
|
||||||
colIndex++;
|
|
||||||
}
|
|
||||||
if(lastObjFlag){
|
|
||||||
addTitleToRowList(fixedCol, rowAssist, t, dataLength, emptyRowCount, rowList, fieldList);
|
|
||||||
if("1".equals(hasRange))
|
|
||||||
addRangeToRowList(rowAssist, r, dataLength, emptyRowCount, rowList);
|
|
||||||
}
|
}
|
||||||
|
return rowList;
|
||||||
|
}
|
||||||
|
|
||||||
//=============处理数据============
|
/**
|
||||||
int dataIndex = 1;
|
* @param
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
private void addTitleToRowList(JSONArray fixedCol, JSONArray fixedColRight, Integer dynamicColCount, JSONObject t, JSONArray rowList, List<ConfigReportFieldDO> fieldList){
|
||||||
|
//处理固定列
|
||||||
|
int index = 1;
|
||||||
|
String colKey = "";
|
||||||
|
//固定列-左
|
||||||
|
for(int i=0;i<fixedCol.size();i++) {
|
||||||
|
String col = fixedCol.getString(i);
|
||||||
|
for(ConfigReportFieldDO fieldDO : fieldList) {
|
||||||
|
colKey = "";
|
||||||
|
String fieldName = fieldDO.getFieldName();
|
||||||
|
String fieldType = fieldDO.getFieldType();
|
||||||
|
String field = fieldDO.getField();
|
||||||
|
if (FIELD_DYNAMIC.equals(fieldType) || FIELD_CALCULATED.equals(fieldType))
|
||||||
|
continue;
|
||||||
|
if(sampleNameAndCodeKey.equals( col) && sampleNameAndCodeKey.equals(field)
|
||||||
|
|| sampleNameKey.equals( col) && sampleNameKey.equals(field)
|
||||||
|
|| sampleCodeKey.equals( col) && sampleCodeKey.equals(field)
|
||||||
|
|| entrustSampleNameKey.equals( col) && entrustSampleNameKey.equals(field)
|
||||||
|
|| entrustSampleCodeKey.equals( col) && entrustSampleCodeKey.equals(field)
|
||||||
|
|| entrustSampleNameCodeKey.equals( col) && entrustSampleNameCodeKey.equals(field)){
|
||||||
|
colKey = parseNumToString(index, 2);
|
||||||
|
}
|
||||||
|
if(!ObjectUtils.isEmpty(colKey)){
|
||||||
|
t.put(colPrefix + colKey, fieldName);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//固定列-右
|
||||||
|
index = fixedCol.size() + dynamicColCount + 1;
|
||||||
|
for(int i=0;i<fixedColRight.size();i++) {
|
||||||
|
String col = fixedColRight.getString(i);
|
||||||
|
for(ConfigReportFieldDO fieldDO : fieldList) {
|
||||||
|
colKey = "";
|
||||||
|
String fieldName = fieldDO.getFieldName();
|
||||||
|
String fieldType = fieldDO.getFieldType();
|
||||||
|
String field = fieldDO.getField();
|
||||||
|
if (FIELD_DYNAMIC.equals(fieldType) || FIELD_CALCULATED.equals(fieldType))
|
||||||
|
continue;
|
||||||
|
if(sampleNameAndCodeKey.equals( col) && sampleNameAndCodeKey.equals(field)
|
||||||
|
|| sampleNameKey.equals( col) && sampleNameKey.equals(field)
|
||||||
|
|| sampleCodeKey.equals( col) && sampleCodeKey.equals(field)
|
||||||
|
|| entrustSampleNameKey.equals( col) && entrustSampleNameKey.equals(field)
|
||||||
|
|| entrustSampleCodeKey.equals( col) && entrustSampleCodeKey.equals(field)
|
||||||
|
|| entrustSampleNameCodeKey.equals( col) && entrustSampleNameCodeKey.equals(field)){
|
||||||
|
colKey = parseNumToString(index, 2);
|
||||||
|
}
|
||||||
|
if(!ObjectUtils.isEmpty(colKey)){
|
||||||
|
t.put(colPrefix + colKey, fieldName);
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rowList.add(t.clone());
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加行数据
|
||||||
|
private void addDataToRowList(JSONArray fixedCol, JSONArray fixedColRight, List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, JSONArray rowList, int fixedColCount, int dynamicColCount, String hasRemark){
|
||||||
|
int colIndex = 0;
|
||||||
|
JSONObject t = new JSONObject();
|
||||||
for(ReportDocumentDataDO dataDO : dataList){
|
for(ReportDocumentDataDO dataDO : dataList){
|
||||||
String documentContent = dataDO.getDocumentContent();
|
String documentContent = dataDO.getDocumentContent();
|
||||||
String externalContent = dataDO.getExternalContent();
|
String externalContent = dataDO.getExternalContent();
|
||||||
JSONObject s = JSONObject.parseObject(documentContent);
|
JSONObject s = JSONObject.parseObject(documentContent);
|
||||||
JSONObject e = new JSONObject();
|
//判断样品是否有值,若无值则跳过
|
||||||
if(!ObjectUtils.isEmpty(externalContent)){
|
boolean hasValue = false;
|
||||||
e = JSONObject.parseObject(externalContent);
|
for(ConfigReportFieldDO fieldDO : fieldList) {
|
||||||
|
String fieldType = fieldDO.getFieldType();
|
||||||
|
if (FIELD_FIXED.equals(fieldType)) //这里只处理动态列。固定列在 addDataToRowList 处理
|
||||||
|
continue;
|
||||||
|
String field = fieldDO.getField();
|
||||||
|
JSONObject fieldObj = s.getJSONObject(field);
|
||||||
|
String fieldValue = "";
|
||||||
|
if (fieldObj != null)
|
||||||
|
fieldValue = fieldObj.getString("fieldValue");
|
||||||
|
if(!ObjectUtils.isEmpty(fieldValue))
|
||||||
|
hasValue = true;
|
||||||
}
|
}
|
||||||
|
if(!hasValue)
|
||||||
|
continue;
|
||||||
|
JSONObject e = new JSONObject();
|
||||||
|
if(!ObjectUtils.isEmpty(externalContent))
|
||||||
|
e = JSONObject.parseObject(externalContent);
|
||||||
String remark = e.getString("remark");
|
String remark = e.getString("remark");
|
||||||
colIndex = fixedColCount + 1;
|
colIndex = fixedColCount + 1;
|
||||||
rowAssist = 1;
|
|
||||||
t = new JSONObject();
|
t = new JSONObject();
|
||||||
|
int colCountOneSample = fixedColCount + dynamicColCount;
|
||||||
if("1".equals(hasRemark)){
|
if("1".equals(hasRemark)){
|
||||||
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark);
|
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark);
|
||||||
}
|
}
|
||||||
@@ -249,157 +451,63 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
}
|
}
|
||||||
if(!ObjectUtils.isEmpty(mathSymbol) && !"=".equals(mathSymbol))
|
if(!ObjectUtils.isEmpty(mathSymbol) && !"=".equals(mathSymbol))
|
||||||
fieldValue = mathSymbol + fieldValue;
|
fieldValue = mathSymbol + fieldValue;
|
||||||
|
if(ObjectUtils.isEmpty(fieldValue))
|
||||||
|
fieldValue = "/";
|
||||||
t.put(colPrefix + colKey, fieldValue);
|
t.put(colPrefix + colKey, fieldValue);
|
||||||
lastObjFlag = true;
|
|
||||||
if(colIndex % colCountOneSample == 0){
|
|
||||||
addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList);
|
|
||||||
t = new JSONObject();
|
|
||||||
if("1".equals(hasRemark)){
|
|
||||||
t.put(colPrefix + parseNumToString(colCountOneSample + 1, 2), remark);
|
|
||||||
}
|
|
||||||
rowAssist++;
|
|
||||||
colIndex = fixedColCount + 1; //第二组以后,从固定列数开始
|
|
||||||
lastObjFlag = false;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
colIndex++;
|
colIndex++;
|
||||||
}
|
}
|
||||||
if(lastObjFlag){
|
t.put("id", dataDO.getId());
|
||||||
addFixedDataToRowList(fixedCol, dataDO, rowAssist, t, dataLength, emptyRowCount, dataIndex, rowList, fieldList);
|
//处理固定列-左
|
||||||
}
|
int index = 1;
|
||||||
dataIndex ++;
|
String colKey = "";
|
||||||
}
|
|
||||||
|
|
||||||
//==============以下为空白=================
|
|
||||||
//实际使用行数小于总行数,显示“”以下为空白“
|
|
||||||
if(dataLength < maxRowCount){
|
|
||||||
String colKey = colPrefix + "01";
|
|
||||||
t = new JSONObject();
|
|
||||||
t.put(colKey, emptyText);
|
|
||||||
int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 2;
|
|
||||||
if(rowAssist == 1)
|
|
||||||
rowIndex = dataLength + emptyRowCount;
|
|
||||||
if(rowCountOneSample == 1)
|
|
||||||
rowIndex = dataLength + 2;
|
|
||||||
rowList.set(rowIndex, t.clone());
|
|
||||||
}
|
|
||||||
//前面的计数是从1开始,移除第一个元素
|
|
||||||
if(!rowList.isEmpty())
|
|
||||||
rowList.remove(0);
|
|
||||||
return rowList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param
|
|
||||||
*
|
|
||||||
* */
|
|
||||||
private void addTitleToRowList(JSONArray fixedCol, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, List<JSONObject> rowList, List<ConfigReportFieldDO> fieldList){
|
|
||||||
int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + 1; //(标题 + 数据行 + 空行)
|
|
||||||
//处理固定列
|
|
||||||
int index = 1;
|
|
||||||
String colKey = "";
|
|
||||||
for(int i=0;i<fixedCol.size();i++) {
|
|
||||||
String col = fixedCol.getString(i);
|
|
||||||
for(ConfigReportFieldDO fieldDO : fieldList) {
|
|
||||||
String fieldName = fieldDO.getFieldName();
|
|
||||||
String fieldType = fieldDO.getFieldType();
|
|
||||||
String field = fieldDO.getField();
|
|
||||||
if (FIELD_DYNAMIC.equals(fieldType))
|
|
||||||
continue;
|
|
||||||
if("sampleNameCode".equals( col) && "SMP_NAME_CD".equals(field)){
|
|
||||||
// String sampleNameCode = "样品名称及编号";
|
|
||||||
// String sampleNameCode = fieldName;
|
|
||||||
colKey = parseNumToString(index, 2);
|
|
||||||
t.put(colPrefix + colKey, fieldName);
|
|
||||||
index++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if("sampleName".equals( col) && "SMP_NAME".equals(field)){
|
|
||||||
colKey = parseNumToString(index, 2);
|
|
||||||
t.put(colPrefix + colKey, fieldName);
|
|
||||||
index++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if("sampleCode".equals( col) && "SMP_CD".equals(field)){
|
|
||||||
colKey = parseNumToString(index, 2);
|
|
||||||
t.put(colPrefix + colKey, fieldName);
|
|
||||||
index++;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rowList.set(rowIndex, t.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理检出限
|
|
||||||
* 如果是
|
|
||||||
* */
|
|
||||||
private void addRangeToRowList(Integer rowAssist, JSONObject r, Integer dataLength, Integer emptyRowCount, List<JSONObject> rowList){
|
|
||||||
int rowIndex = (dataLength + emptyRowCount + 1 ) * (rowAssist);
|
|
||||||
rowList.set(rowIndex, r.clone());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加固定列的数据
|
|
||||||
* */
|
|
||||||
private void addFixedDataToRowList(JSONArray fixedCol, ReportDocumentDataDO dataDO, Integer rowAssist, JSONObject t, Integer dataLength, Integer emptyRowCount, Integer dataIndex, List<JSONObject> rowList, List<ConfigReportFieldDO> fieldList){
|
|
||||||
int rowIndex = (1 + dataLength + emptyRowCount) * (rowAssist - 1) + dataIndex + 1; //(标题 + 数据行 + 空行)
|
|
||||||
t.put("id", dataDO.getId());
|
|
||||||
//处理固定列
|
|
||||||
int index = 1;
|
|
||||||
//处理固定列
|
|
||||||
String colKey = "";
|
|
||||||
if(fixedCol != null && !fixedCol.isEmpty()){
|
|
||||||
for(int i=0;i<fixedCol.size();i++){
|
for(int i=0;i<fixedCol.size();i++){
|
||||||
String col = fixedCol.getString(i);
|
String col = fixedCol.getString(i);
|
||||||
colKey = parseNumToString(index, 2);
|
colKey = parseNumToString(index, 2);
|
||||||
if("sampleName".equals(col)){
|
if(sampleNameKey.equals(col)){
|
||||||
t.put(colPrefix + colKey, dataDO.getSampleName());
|
t.put(colPrefix + colKey, dataDO.getSampleName());
|
||||||
}
|
}
|
||||||
else if("sampleCode".equals(col)){
|
else if(sampleCodeKey.equals(col)){
|
||||||
t.put(colPrefix + colKey, dataDO.getSampleCode());
|
t.put(colPrefix + colKey, dataDO.getSampleCode());
|
||||||
}
|
}
|
||||||
else if("sampleNameCode".equals( col)){
|
else if(sampleNameAndCodeKey.equals( col)){
|
||||||
t.put(colPrefix + colKey, dataDO.getSampleName() + " " + dataDO.getSampleCode());
|
t.put(colPrefix + colKey, dataDO.getSampleName() + " " + dataDO.getSampleCode());
|
||||||
|
}else if(entrustSampleNameKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleName());
|
||||||
|
}else if(entrustSampleCodeKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleCode());
|
||||||
|
}else if(entrustSampleNameCodeKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleName() + " " + dataDO.getEntrustSampleCode());
|
||||||
}
|
}
|
||||||
index ++;
|
index ++;
|
||||||
}
|
}
|
||||||
|
//处理固定列-右
|
||||||
|
index = fixedColRight.size() + dynamicColCount + 1;
|
||||||
|
for(int i=0;i<fixedColRight.size();i++){
|
||||||
|
String col = fixedColRight.getString(i);
|
||||||
|
colKey = parseNumToString(index, 2);
|
||||||
|
if(sampleNameKey.equals(col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getSampleName());
|
||||||
|
}
|
||||||
|
else if(sampleCodeKey.equals(col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getSampleCode());
|
||||||
|
}
|
||||||
|
else if(sampleNameAndCodeKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getSampleName() + " " + dataDO.getSampleCode());
|
||||||
|
}else if(entrustSampleNameKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleName());
|
||||||
|
}else if(entrustSampleCodeKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleCode());
|
||||||
|
}else if(entrustSampleNameCodeKey.equals( col)){
|
||||||
|
t.put(colPrefix + colKey, dataDO.getEntrustSampleName() + " " + dataDO.getEntrustSampleCode());
|
||||||
|
}
|
||||||
|
index ++;
|
||||||
|
}
|
||||||
|
//添加入行数据
|
||||||
|
rowList.add(t.clone());
|
||||||
}
|
}
|
||||||
// if(name_code_merge.equals(nameCodeType)){
|
|
||||||
// String merge = dataDO.getSampleName() + " " + dataDO.getSampleCode();
|
|
||||||
// t.put(colPrefix + colKey, merge);
|
|
||||||
// rowList.set(rowIndex, t.clone());
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if(name_code_name.equals(nameCodeType)){
|
|
||||||
// t.put(colPrefix + colKey, dataDO.getSampleName());
|
|
||||||
// rowList.set(rowIndex, t.clone());
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// if(name_code_code.equals(nameCodeType)){
|
|
||||||
// t.put(colPrefix + colKey, dataDO.getSampleCode());
|
|
||||||
// rowList.set(rowIndex, t.clone());
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// for(ConfigReportFieldDO fieldDO : fieldList){
|
|
||||||
// String fieldName = fieldDO.getFieldName();
|
|
||||||
// String fieldType = fieldDO.getFieldType();
|
|
||||||
// String field = fieldDO.getField();
|
|
||||||
// if(FIELD_FIXED.equals(fieldType)){
|
|
||||||
// colKey = parseNumToString(index, 2);
|
|
||||||
// String val = "";
|
|
||||||
// if(sampleNameKey.equals( field))
|
|
||||||
// val = dataDO.getSampleName();
|
|
||||||
// else if(sampleCodeKey.equals( field))
|
|
||||||
// val = dataDO.getSampleCode();
|
|
||||||
// t.put(colPrefix + colKey, val);
|
|
||||||
// index++;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
rowList.set(rowIndex, t.clone());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String parseNumToString(int num, int len){
|
private String parseNumToString(int num, int len){
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for(int i = 0; i < len - String.valueOf(num).length(); i++){
|
for(int i = 0; i < len - String.valueOf(num).length(); i++){
|
||||||
@@ -411,7 +519,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
/**
|
/**
|
||||||
* 组装固定检测项的数据,以检测项作为数据Key
|
* 组装固定检测项的数据,以检测项作为数据Key
|
||||||
* */
|
* */
|
||||||
private List<JSONObject> assembleFixedFieldsData(List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig){
|
private JSONArray assembleFixedFieldsData(JSONArray rowList, List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig){
|
||||||
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
||||||
|
|
||||||
Integer maxRowCount = 3;
|
Integer maxRowCount = 3;
|
||||||
@@ -421,15 +529,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key
|
String fixedFields = jsonObject.getString("fixedFields"); //固定检测项。如果固定检测项,则以检测项作为数据Key
|
||||||
JSONArray fixedFieldsArray = JSONArray.parseArray(fixedFields);
|
JSONArray fixedFieldsArray = JSONArray.parseArray(fixedFields);
|
||||||
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
if(!ObjectUtils.isEmpty(maxRowCountStr)) maxRowCount = Integer.parseInt(maxRowCountStr);
|
||||||
|
// for(int i = 0; i < maxRowCount; i++){
|
||||||
List<JSONObject> rowList = new ArrayList<>();
|
// JSONObject row = new JSONObject();
|
||||||
for(int i = 0; i < maxRowCount; i++){
|
// row.put("sampleNameCode", " ");
|
||||||
JSONObject row = new JSONObject();
|
// row.put("sampleName", " ");
|
||||||
row.put("sampleNameCode", " ");
|
// row.put("sampleCode", " ");
|
||||||
row.put("sampleName", " ");
|
// rowList.add( row);
|
||||||
row.put("sampleCode", " ");
|
// }
|
||||||
rowList.add( row);
|
|
||||||
}
|
|
||||||
for(ReportDocumentDataDO dataDO : dataList) {
|
for(ReportDocumentDataDO dataDO : dataList) {
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
String documentContent = dataDO.getDocumentContent();
|
String documentContent = dataDO.getDocumentContent();
|
||||||
@@ -476,6 +582,13 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
t.put("sampleCode", emptyText);
|
t.put("sampleCode", emptyText);
|
||||||
rowList.add( t);
|
rowList.add( t);
|
||||||
}
|
}
|
||||||
|
while(rowList.size() < maxRowCount){
|
||||||
|
JSONObject t = new JSONObject();
|
||||||
|
t.put("sampleNameCode", " ");
|
||||||
|
t.put("sampleName", " ");
|
||||||
|
t.put("sampleCode", " ");
|
||||||
|
rowList.add( t);
|
||||||
|
}
|
||||||
return rowList;
|
return rowList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,17 +596,15 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
* 组装纵表数据
|
* 组装纵表数据
|
||||||
* 第1列固定为:元素; 第2列:方法检出限(%);第三列开始为各个样品
|
* 第1列固定为:元素; 第2列:方法检出限(%);第三列开始为各个样品
|
||||||
* */
|
* */
|
||||||
private List<JSONObject> assembleVerticalData(List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig){
|
private JSONArray assembleVerticalData(JSONArray rowList, List<ConfigReportFieldDO> fieldList, List<ReportDocumentDataDO> dataList, String customConfig){
|
||||||
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
JSONObject jsonObject = JSONObject.parseObject(customConfig);
|
||||||
Integer dynamicColCount = 3;
|
Integer dynamicColCount = 3;
|
||||||
Integer fixedColCount = 2;
|
Integer fixedColCount = 1;
|
||||||
Integer maxRowCount = 3;
|
Integer maxRowCount = 20;
|
||||||
String dynamicColCountStr = jsonObject.getString("dynamicColCount"); //动态列(检测项)数量
|
|
||||||
String fixedColCountStr = jsonObject.getString("fixedColCount"); //固定列(样品名称、样品编号等)数量
|
|
||||||
String maxRowCountStr = jsonObject.getString("maxRowCount"); //最大行数
|
|
||||||
String nameCodeType = jsonObject.getString("nameCodeType"); //名称、编号处理方式:merge-合并, name-只显示名称, code-只显示编号, split-2列分开显示
|
|
||||||
String hasRemark = jsonObject.getString("hasRemark"); //是否有备注
|
String hasRemark = jsonObject.getString("hasRemark"); //是否有备注
|
||||||
String hasRange = jsonObject.getString("hasRange"); //是否有检出限
|
String hasRange = jsonObject.getString("hasRange"); //是否有检出限
|
||||||
|
if("1".equals(hasRange))
|
||||||
|
fixedColCount ++;
|
||||||
//取数据第一行,用于处理方法检出限
|
//取数据第一行,用于处理方法检出限
|
||||||
String content = "";
|
String content = "";
|
||||||
if(!ObjectUtils.isEmpty(dataList))
|
if(!ObjectUtils.isEmpty(dataList))
|
||||||
@@ -502,11 +613,14 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
if(!ObjectUtils.isEmpty(content)){
|
if(!ObjectUtils.isEmpty(content)){
|
||||||
firstData = JSONObject.parseObject(content);
|
firstData = JSONObject.parseObject(content);
|
||||||
}
|
}
|
||||||
List<JSONObject> rowList = new ArrayList<>();
|
|
||||||
//处理第一行-样品编号
|
//处理第一行-样品编号
|
||||||
int colIndex = fixedColCount + 1;
|
int colIndex = fixedColCount + 1;
|
||||||
int rowIndex = 1;
|
int rowIndex = 1;
|
||||||
JSONObject t = new JSONObject();
|
JSONObject t = new JSONObject();
|
||||||
|
t.put(colPrefix + "01", "元素");
|
||||||
|
if("1".equals(hasRange)){
|
||||||
|
t.put(colPrefix + "02", "方法检出限");
|
||||||
|
}
|
||||||
for(ReportDocumentDataDO dataDO : dataList){
|
for(ReportDocumentDataDO dataDO : dataList){
|
||||||
String colKey = parseNumToString(colIndex, 2);
|
String colKey = parseNumToString(colIndex, 2);
|
||||||
t.put(colPrefix + colKey, dataDO.getSampleCode());
|
t.put(colPrefix + colKey, dataDO.getSampleCode());
|
||||||
@@ -565,7 +679,7 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService
|
|||||||
public CommonResult<List<ReportDocumentDataDO>> listByMainDataId(Long mainDataId) {
|
public CommonResult<List<ReportDocumentDataDO>> listByMainDataId(Long mainDataId) {
|
||||||
QueryWrapper<ReportDocumentDataDO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ReportDocumentDataDO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("MAIN_ID", mainDataId);
|
queryWrapper.eq("MAIN_ID", mainDataId);
|
||||||
queryWrapper.orderByAsc("ID");
|
queryWrapper.orderByAsc("SRT");
|
||||||
List<ReportDocumentDataDO> list = reportDocumentDataMapper.selectList(queryWrapper);
|
List<ReportDocumentDataDO> list = reportDocumentDataMapper.selectList(queryWrapper);
|
||||||
return CommonResult.success(list);
|
return CommonResult.success(list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告附件 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ReportDocumentFileService {
|
||||||
|
|
||||||
|
ReportDocumentFileDO getByMainIdAndVersion(Long mainId, Integer version);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建检测报告附件
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ReportDocumentFileRespVO createReportDocumentFile(@Valid ReportDocumentFileSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新检测报告附件
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateReportDocumentFile(@Valid ReportDocumentFileSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除检测报告附件
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteReportDocumentFile(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除检测报告附件
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteReportDocumentFileListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得检测报告附件
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 检测报告附件
|
||||||
|
*/
|
||||||
|
ReportDocumentFileDO getReportDocumentFile(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得检测报告附件分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 检测报告附件分页
|
||||||
|
*/
|
||||||
|
PageResult<ReportDocumentFileDO> getReportDocumentFilePage(ReportDocumentFilePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.zt.plat.module.qms.business.reportdoc.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentFileMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检测报告附件 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ReportDocumentFileServiceImpl implements ReportDocumentFileService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ReportDocumentFileMapper reportDocumentFileMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReportDocumentFileDO getByMainIdAndVersion(Long mainId, Integer version) {
|
||||||
|
LambdaQueryWrapper<ReportDocumentFileDO> query = new LambdaQueryWrapper<>();
|
||||||
|
query.eq(ReportDocumentFileDO::getMainId, mainId);
|
||||||
|
query.eq(ReportDocumentFileDO::getVersion, version);
|
||||||
|
return reportDocumentFileMapper.selectOne(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReportDocumentFileRespVO createReportDocumentFile(ReportDocumentFileSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ReportDocumentFileDO reportDocumentFile = BeanUtils.toBean(createReqVO, ReportDocumentFileDO.class);
|
||||||
|
reportDocumentFileMapper.insert(reportDocumentFile);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(reportDocumentFile, ReportDocumentFileRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateReportDocumentFile(ReportDocumentFileSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateReportDocumentFileExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ReportDocumentFileDO updateObj = BeanUtils.toBean(updateReqVO, ReportDocumentFileDO.class);
|
||||||
|
reportDocumentFileMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteReportDocumentFile(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateReportDocumentFileExists(id);
|
||||||
|
// 删除
|
||||||
|
reportDocumentFileMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteReportDocumentFileListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateReportDocumentFileExists(ids);
|
||||||
|
// 删除
|
||||||
|
reportDocumentFileMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateReportDocumentFileExists(List<Long> ids) {
|
||||||
|
List<ReportDocumentFileDO> list = reportDocumentFileMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(REPORT_DOCUMENT_FILE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateReportDocumentFileExists(Long id) {
|
||||||
|
if (reportDocumentFileMapper.selectById(id) == null) {
|
||||||
|
throw exception(REPORT_DOCUMENT_FILE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReportDocumentFileDO getReportDocumentFile(Long id) {
|
||||||
|
return reportDocumentFileMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ReportDocumentFileDO> getReportDocumentFilePage(ReportDocumentFilePageReqVO pageReqVO) {
|
||||||
|
return reportDocumentFileMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,6 +22,8 @@ public interface ReportDocumentMainCorrelationService {
|
|||||||
|
|
||||||
void deleteByMainId(Long mainId);
|
void deleteByMainId(Long mainId);
|
||||||
|
|
||||||
|
void insertBatch(List<ReportDocumentMainCorrelationDO> list);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建检测报告关系表
|
* 创建检测报告关系表
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ public class ReportDocumentMainCorrelationServiceImpl implements ReportDocumentM
|
|||||||
reportDocumentMainCorrelationMapper.delete(query);
|
reportDocumentMainCorrelationMapper.delete(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertBatch(List<ReportDocumentMainCorrelationDO> list) {
|
||||||
|
reportDocumentMainCorrelationMapper.insertBatch(list);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO updateReqVO) {
|
public void updateReportDocumentMainCorrelation(ReportDocumentMainCorrelationSaveReqVO updateReqVO) {
|
||||||
// 校验存在
|
// 校验存在
|
||||||
|
|||||||
@@ -3,8 +3,11 @@ package com.zt.plat.module.qms.business.reportdoc.service;
|
|||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
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.BusinessSampleEntrustRegistrationDO;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkOperationRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.iwork.dto.IWorkWorkflowCreateReqDTO;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -23,7 +26,7 @@ public interface ReportDocumentMainService {
|
|||||||
CommonResult<String> execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO);
|
CommonResult<String> execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO);
|
||||||
|
|
||||||
//添加数据到报告-按表表数据
|
//添加数据到报告-按表表数据
|
||||||
CommonResult<String> execAddByBusinessAssayReportData(List<BusinessAssayReportDataDO> assayReportDataList, Long id);
|
CommonResult<String> execAddByBusinessAssayReportData(List<BusinessAssayReportDataDO> assayReportDataList, Long id, List<BusinessSampleEntrustRegistrationDO> entrustList);
|
||||||
|
|
||||||
//移除数据
|
//移除数据
|
||||||
CommonResult<String> execRemoveData(ReportDocumentMainSaveReqVO reqVO);
|
CommonResult<String> execRemoveData(ReportDocumentMainSaveReqVO reqVO);
|
||||||
@@ -82,4 +85,6 @@ public interface ReportDocumentMainService {
|
|||||||
//发起流程
|
//发起流程
|
||||||
CommonResult<ReportDocumentMainRespVO> createProcessInstance(ReportDocumentMainSaveReqVO entity);
|
CommonResult<ReportDocumentMainRespVO> createProcessInstance(ReportDocumentMainSaveReqVO entity);
|
||||||
|
|
||||||
|
|
||||||
|
void testAsyncTask(Long id);
|
||||||
}
|
}
|
||||||
@@ -17,28 +17,31 @@ import com.zt.plat.module.qms.api.task.BMPCallbackInterface;
|
|||||||
import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO;
|
import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO;
|
||||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO;
|
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO;
|
||||||
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.BusinessSampleEntrustRegistrationDO;
|
||||||
import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService;
|
import com.zt.plat.module.qms.business.bus.service.BusinessAssayReportDataService;
|
||||||
|
import com.zt.plat.module.qms.business.bus.service.BusinessSampleEntrustRegistrationService;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
||||||
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainCorrelationDO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentTypeDO;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainMapper;
|
import com.zt.plat.module.qms.business.reportdoc.dal.mapper.ReportDocumentMainMapper;
|
||||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||||
|
import com.zt.plat.module.qms.common.data.service.DataKeyCheckService;
|
||||||
import com.zt.plat.module.qms.enums.QmsBpmConstant;
|
import com.zt.plat.module.qms.enums.QmsBpmConstant;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
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;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||||
@@ -62,7 +65,29 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
@Resource private BpmProcessInstanceApi bpmProcessInstanceApi;
|
@Resource private BpmProcessInstanceApi bpmProcessInstanceApi;
|
||||||
@Resource private BpmTaskApi bpmTaskApi;
|
@Resource private BpmTaskApi bpmTaskApi;
|
||||||
@Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService;
|
@Resource private ReportDocumentMainCorrelationService reportDocumentMainCorrelationService;
|
||||||
|
@Resource private ReportDocumentTypeService reportDocumentTypeService;
|
||||||
@Resource private ConfigUserSignatureService configUserSignatureService;
|
@Resource private ConfigUserSignatureService configUserSignatureService;
|
||||||
|
@Resource private BusinessSampleEntrustRegistrationService businessSampleEntrustRegistrationService;
|
||||||
|
@Resource private ReportDocumentAssistService reportDocumentAssistService;
|
||||||
|
@Resource private DataKeyCheckService dataKeyCheckService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 测试异步执行
|
||||||
|
* */
|
||||||
|
@Async("asyncTaskExecutor")
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void testAsyncTask(Long id) {
|
||||||
|
ReportDocumentMainDO entity = reportDocumentMainMapper.selectById(id);
|
||||||
|
entity.setFlowStatus("success");
|
||||||
|
try {
|
||||||
|
Thread.sleep(10000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
reportDocumentMainMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 增加报表数据(按样品)
|
* 增加报表数据(按样品)
|
||||||
* 传入:报告id、 报表数据ids
|
* 传入:报告id、 报表数据ids
|
||||||
@@ -93,14 +118,13 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
}
|
}
|
||||||
if(isExist)
|
if(isExist)
|
||||||
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "报表数据已在本报告使用,请勿重复添加");
|
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "报表数据已在本报告使用,请勿重复添加");
|
||||||
// List<BusinessAssayReportDataDO> assayReportDataList = businessAssayReportDataService.listByIds(addReportDataIdList);
|
|
||||||
BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO();
|
BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO();
|
||||||
reportDataQueryVo.setIdList(addReportDataIdList);
|
reportDataQueryVo.setIdList(addReportDataIdList);
|
||||||
reportDataQueryVo.setPageNo(1);
|
reportDataQueryVo.setPageNo(1);
|
||||||
reportDataQueryVo.setPageSize(9999);
|
reportDataQueryVo.setPageSize(9999);
|
||||||
PageResult<BusinessAssayReportDataDO> assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo);
|
PageResult<BusinessAssayReportDataDO> assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo);
|
||||||
List<BusinessAssayReportDataDO> assayReportDataList = assayReportPage.getList();
|
List<BusinessAssayReportDataDO> assayReportDataList = assayReportPage.getList();
|
||||||
return execAddByBusinessAssayReportData(assayReportDataList, id);
|
return execAddByBusinessAssayReportData(assayReportDataList, id, new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -108,39 +132,44 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
public CommonResult<String> execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO) {
|
public CommonResult<String> execAddDataByEntrust(ReportDocumentMainSaveReqVO reqVO) {
|
||||||
Long id = reqVO.getId();
|
Long id = reqVO.getId();
|
||||||
String businessSampleEntrustRegistrationIds = reqVO.getBusinessSampleEntrustRegistrationIds();
|
String businessSampleEntrustRegistrationIds = reqVO.getBusinessSampleEntrustRegistrationIds();
|
||||||
if(ObjectUtils.isEmpty(businessSampleEntrustRegistrationIds) || id == null)
|
if(id == null)
|
||||||
|
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少id参数,请刷新后重试");
|
||||||
|
if(ObjectUtils.isEmpty(businessSampleEntrustRegistrationIds))
|
||||||
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少businessSampleEntrustRegistrationIds参数,请刷新后重试");
|
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "缺少businessSampleEntrustRegistrationIds参数,请刷新后重试");
|
||||||
List<ReportDocumentMainCorrelationDO> reportRelationList = reportDocumentMainCorrelationService.listByMainId(id);
|
|
||||||
//todo 判断修改的场景。处理方法:删除reportRelation、ReportDocumentData
|
|
||||||
List<Long> businessSampleEntrustRegistrationIdList = new ArrayList<>();
|
List<Long> businessSampleEntrustRegistrationIdList = new ArrayList<>();
|
||||||
String[] split = businessSampleEntrustRegistrationIds.split(",");
|
String[] split = businessSampleEntrustRegistrationIds.split(",");
|
||||||
for (String s : split) {
|
for (String s : split) {
|
||||||
Long aLong = Long.valueOf(s);
|
Long aLong = Long.valueOf(s);
|
||||||
businessSampleEntrustRegistrationIdList.add(aLong);
|
businessSampleEntrustRegistrationIdList.add(aLong);
|
||||||
}
|
}
|
||||||
|
List<BusinessSampleEntrustRegistrationDO> entrustList = businessSampleEntrustRegistrationService.listByIds(businessSampleEntrustRegistrationIdList);
|
||||||
BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO();
|
BusinessAssayReportDataPageReqVO reportDataQueryVo = new BusinessAssayReportDataPageReqVO();
|
||||||
reportDataQueryVo.setBusinessSampleEntrustRegistrationIdList(businessSampleEntrustRegistrationIdList);
|
reportDataQueryVo.setBusinessSampleEntrustRegistrationIdList(businessSampleEntrustRegistrationIdList);
|
||||||
reportDataQueryVo.setPageNo(1);
|
reportDataQueryVo.setPageNo(1);
|
||||||
reportDataQueryVo.setPageSize(9999);
|
reportDataQueryVo.setPageSize(9999);
|
||||||
PageResult<BusinessAssayReportDataDO> assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo);
|
PageResult<BusinessAssayReportDataDO> assayReportPage = businessAssayReportDataService.queryWaitingDataForReport( reportDataQueryVo);
|
||||||
List<BusinessAssayReportDataDO> assayReportDataList = assayReportPage.getList();
|
List<BusinessAssayReportDataDO> assayReportDataList = assayReportPage.getList();
|
||||||
CommonResult<String> ret = execAddByBusinessAssayReportData(assayReportDataList, id);
|
CommonResult<String> ret = execAddByBusinessAssayReportData(assayReportDataList, id, entrustList);
|
||||||
if(!ret.isSuccess())
|
if(!ret.isSuccess())
|
||||||
return ret;
|
return ret;
|
||||||
//保存报告关系表
|
//保存报告关系表
|
||||||
|
List<ReportDocumentMainCorrelationDO> correlationList = new ArrayList<>();
|
||||||
for(Long businessSampleEntrustRegistrationId : businessSampleEntrustRegistrationIdList){
|
for(Long businessSampleEntrustRegistrationId : businessSampleEntrustRegistrationIdList){
|
||||||
ReportDocumentMainCorrelationSaveReqVO correlationEntity = new ReportDocumentMainCorrelationSaveReqVO();
|
ReportDocumentMainCorrelationDO correlationEntity = new ReportDocumentMainCorrelationDO();
|
||||||
correlationEntity.setMainId( id);
|
correlationEntity.setMainId( id);
|
||||||
correlationEntity.setCorrelationId(businessSampleEntrustRegistrationId);
|
correlationEntity.setCorrelationId(businessSampleEntrustRegistrationId);
|
||||||
correlationEntity.setCorrelationType(ReportDocumentMainCorrelationService.CorrelationType_entrust);
|
correlationEntity.setCorrelationType(ReportDocumentMainCorrelationService.CorrelationType_entrust);
|
||||||
reportDocumentMainCorrelationService.createReportDocumentMainCorrelation(correlationEntity);
|
correlationList.add(correlationEntity);
|
||||||
}
|
}
|
||||||
|
if(!correlationList.isEmpty())
|
||||||
|
reportDocumentMainCorrelationService.insertBatch(correlationList);
|
||||||
|
|
||||||
return CommonResult.success("操作成功");
|
return CommonResult.success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CommonResult<String> execAddByBusinessAssayReportData(List<BusinessAssayReportDataDO> assayReportDataList, Long id){
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public CommonResult<String> execAddByBusinessAssayReportData(List<BusinessAssayReportDataDO> assayReportDataList, Long id, List<BusinessSampleEntrustRegistrationDO> entrustList){
|
||||||
if(ObjectUtils.isEmpty(assayReportDataList))
|
if(ObjectUtils.isEmpty(assayReportDataList))
|
||||||
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "您选择的委托还没产生可编制报告的数据,请稍后重试!");
|
return error(REPORT_DOCUMENT_DATA_NOT_EXISTS.getCode(), "您选择的委托还没产生可编制报告的数据,请稍后重试!");
|
||||||
List<ReportDocumentDataDO> insertList = new ArrayList<>();
|
List<ReportDocumentDataDO> insertList = new ArrayList<>();
|
||||||
@@ -152,16 +181,75 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
reportDocumentDataDO.setSampleName(assayReportData.getSampleName());
|
reportDocumentDataDO.setSampleName(assayReportData.getSampleName());
|
||||||
reportDocumentDataDO.setBaseSampleName(assayReportData.getBaseSampleName());
|
reportDocumentDataDO.setBaseSampleName(assayReportData.getBaseSampleName());
|
||||||
reportDocumentDataDO.setDocumentContent(assayReportData.getAssayData());
|
reportDocumentDataDO.setDocumentContent(assayReportData.getAssayData());
|
||||||
|
reportDocumentDataDO.setSampleTypeKey(assayReportData.getSampleTypeKey());
|
||||||
|
reportDocumentDataDO.setEntrustSampleCode(assayReportData.getEntrustSampleCode());
|
||||||
|
reportDocumentDataDO.setEntrustSampleName(assayReportData.getEntrustSampleName());
|
||||||
|
reportDocumentDataDO.setSort(assayReportData.getEntrustDetailSort());
|
||||||
insertList.add(reportDocumentDataDO);
|
insertList.add(reportDocumentDataDO);
|
||||||
}
|
}
|
||||||
if(!insertList.isEmpty())
|
if(!insertList.isEmpty())
|
||||||
reportDocumentDataService.insertBatch(insertList);
|
reportDocumentDataService.insertBatch(insertList);
|
||||||
ReportDocumentMainDO reportDocumentMainDO = reportDocumentMainMapper.selectById(id);
|
ReportDocumentMainDO reportDocumentMainDO = reportDocumentMainMapper.selectById(id);
|
||||||
updateCommonField(reportDocumentMainDO);
|
updateCommonField(reportDocumentMainDO);
|
||||||
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String formData = reportDocumentMainDO.getFormData();
|
||||||
|
JSONObject formDataJson = new JSONObject();
|
||||||
|
if(!ObjectUtils.isEmpty(formData))
|
||||||
|
formDataJson = JSONObject.parseObject(formData);
|
||||||
|
ReportDocumentTypeDO typeDO = reportDocumentTypeService.getReportDocumentType(reportDocumentMainDO.getReportDocumentTypeId());
|
||||||
|
String customConfig = typeDO.getCustomConfig();
|
||||||
|
String defaultConclusion = "";
|
||||||
|
if(!ObjectUtils.isEmpty(customConfig)){
|
||||||
|
JSONObject config = JSONObject.parseObject(customConfig);
|
||||||
|
defaultConclusion = config.getString("defaultConclusion");
|
||||||
|
}
|
||||||
|
formDataJson.put("conclusion", defaultConclusion);
|
||||||
|
if(!assayReportDataList.isEmpty())
|
||||||
|
formDataJson.put("sampleName", assayReportDataList.get(0).getSampleName());
|
||||||
|
//处理检测标准
|
||||||
|
String standard = assembleStandard(assayReportDataList);
|
||||||
|
formDataJson.put("standard", standard);
|
||||||
|
formDataJson.put("reportTime", sdf.format(new Date()));
|
||||||
|
|
||||||
|
//委托单号
|
||||||
|
String entrustCode = "";
|
||||||
|
if(!ObjectUtils.isEmpty(entrustList)){
|
||||||
|
for(BusinessSampleEntrustRegistrationDO entrust : entrustList){
|
||||||
|
entrustCode += entrust.getEntrustNumber() + ",";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!ObjectUtils.isEmpty(entrustCode))
|
||||||
|
entrustCode = entrustCode.substring(0, entrustCode.length() - 1);
|
||||||
|
formDataJson.put("entrustCode", entrustCode);
|
||||||
|
|
||||||
|
reportDocumentMainDO.setFormData(formDataJson.toJSONString());
|
||||||
reportDocumentMainMapper.updateById(reportDocumentMainDO);
|
reportDocumentMainMapper.updateById(reportDocumentMainDO);
|
||||||
return CommonResult.success("操作成功");
|
return CommonResult.success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//组装检测标准
|
||||||
|
private String assembleStandard(List<BusinessAssayReportDataDO> dataList){
|
||||||
|
Set<String> standardSet = new HashSet<>();
|
||||||
|
for(BusinessAssayReportDataDO data : dataList){
|
||||||
|
String content = data.getAssayData();
|
||||||
|
if(ObjectUtils.isEmpty( content))
|
||||||
|
continue;
|
||||||
|
JSONObject json = JSONObject.parseObject(content);
|
||||||
|
for(String key : json.keySet()){
|
||||||
|
JSONObject obj = json.getJSONObject(key);
|
||||||
|
String methodName = obj.getString("methodName");
|
||||||
|
if(ObjectUtils.isEmpty(methodName))
|
||||||
|
continue;
|
||||||
|
standardSet.add(methodName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(standardSet.isEmpty())
|
||||||
|
return "";
|
||||||
|
return String.join(",", standardSet);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateCommonField(ReportDocumentMainDO reportDocumentMainDO) {
|
public void updateCommonField(ReportDocumentMainDO reportDocumentMainDO) {
|
||||||
if(reportDocumentMainDO == null)
|
if(reportDocumentMainDO == null)
|
||||||
@@ -290,6 +378,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg());
|
throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg());
|
||||||
}
|
}
|
||||||
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
|
//todo 生成报告编号 documentCode
|
||||||
reportDocumentMainMapper.updateById(entity);
|
reportDocumentMainMapper.updateById(entity);
|
||||||
ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class);
|
ReportDocumentMainRespVO respVO = BeanUtils.toBean(entity, ReportDocumentMainRespVO.class);
|
||||||
return CommonResult.success(respVO);
|
return CommonResult.success(respVO);
|
||||||
@@ -324,12 +413,29 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
return CommonResult.success(respVO);
|
return CommonResult.success(respVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//流程回调
|
//流程回调
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public CommonResult<JSONObject> callback(QmsBpmDTO reqDTO) {
|
public CommonResult<JSONObject> callback(QmsBpmDTO reqDTO) {
|
||||||
|
log.error("流程回调:{}", JSONObject.toJSONString(reqDTO));
|
||||||
JSONObject variables = reqDTO.getVariables();
|
JSONObject variables = reqDTO.getVariables();
|
||||||
|
String processInsId = variables.getString(QmsBpmConstant.BPM_PROCESS_INS_ID);
|
||||||
|
String currentActivityInsId = variables.getString(QmsBpmConstant.BPM_CUR_ACTIVITY_INS_ID);
|
||||||
|
String returnFlag = variables.getString(QmsBpmConstant.BPM_REJECT_TO_FIRST_FLAG); //退回标识。在任务监听中设置
|
||||||
|
//同一个节点实例只触发一次
|
||||||
|
String checkKey = currentActivityInsId;
|
||||||
|
if(ObjectUtils.isEmpty(currentActivityInsId))
|
||||||
|
checkKey = processInsId + "-create";
|
||||||
|
if("1".equals(returnFlag))
|
||||||
|
checkKey += "-reject";
|
||||||
|
try{
|
||||||
|
dataKeyCheckService.create(checkKey, this.getClass().getName());
|
||||||
|
}catch (Exception e){
|
||||||
|
// e.printStackTrace();
|
||||||
|
log.error("checkKey 重复:key={}", checkKey);
|
||||||
|
return CommonResult.success(new JSONObject());
|
||||||
|
}
|
||||||
//流程状态 1-提交(含退回) 4-取消流程
|
//流程状态 1-提交(含退回) 4-取消流程
|
||||||
String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS);
|
String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS);
|
||||||
String mainId = variables.getString("mainId");
|
String mainId = variables.getString("mainId");
|
||||||
@@ -338,10 +444,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS);
|
fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS);
|
||||||
}
|
}
|
||||||
ReportDocumentMainDO entity = getReportDocumentMain(Long.valueOf(mainId));
|
ReportDocumentMainDO entity = getReportDocumentMain(Long.valueOf(mainId));
|
||||||
log.error("流程回调:{}", JSONObject.toJSONString(reqDTO));
|
|
||||||
String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID);
|
String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID);
|
||||||
String RETURN_FLAG_PREFIX_KEY = QmsBpmConstant.BPM_CALLBACK_RETURN_FLAG_PREFIX_KEY;
|
|
||||||
String returnFlagKey = RETURN_FLAG_PREFIX_KEY + "Activity_001";
|
|
||||||
|
|
||||||
//判断是否最后一个节点
|
//判断是否最后一个节点
|
||||||
String lastActivityFlag = "0";
|
String lastActivityFlag = "0";
|
||||||
@@ -357,9 +460,8 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//"RETURN_FLAG_Activity_001": true 标识驳回到发起环节
|
//"RETURN_FLAG_Activity_001": true 标识驳回到发起环节
|
||||||
if(variables.containsKey(returnFlagKey) && variables.getString(returnFlagKey).equals("true")){
|
if(("1").equals(returnFlag)){
|
||||||
//驳回。流程需要配置退回到发起节点
|
//驳回。流程需要配置退回到发起节点
|
||||||
entity.setFlowStatus(QmsCommonConstant.REJECTED);
|
entity.setFlowStatus(QmsCommonConstant.REJECTED);
|
||||||
entity.setDocumentSignature("");
|
entity.setDocumentSignature("");
|
||||||
@@ -375,7 +477,23 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
if("1".equals(lastActivityFlag))
|
if("1".equals(lastActivityFlag))
|
||||||
entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批
|
entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批
|
||||||
}
|
}
|
||||||
|
boolean updateDocFileFlag = reportDocumentAssistService.checkUpdateDocFile(variables);
|
||||||
|
if(updateDocFileFlag){
|
||||||
|
Integer version = entity.getDocumentVersion();
|
||||||
|
if(version == null)
|
||||||
|
version = 1;
|
||||||
|
else
|
||||||
|
version++;
|
||||||
|
entity.setDocumentVersion(version); //版本+1
|
||||||
|
}
|
||||||
reportDocumentMainMapper.updateById(entity);
|
reportDocumentMainMapper.updateById(entity);
|
||||||
|
|
||||||
|
try {
|
||||||
|
reportDocumentAssistService.updateDocFileAndCreateIWorkflow( variables, entity);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject ret = new JSONObject();
|
JSONObject ret = new JSONObject();
|
||||||
return CommonResult.success(ret);
|
return CommonResult.success(ret);
|
||||||
}
|
}
|
||||||
@@ -405,5 +523,4 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
signObj.put(currentActivityId, obj);
|
signObj.put(currentActivityId, obj);
|
||||||
entity.setDocumentSignature(signObj.toJSONString());
|
entity.setDocumentSignature(signObj.toJSONString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckRespVO;
|
||||||
|
import com.zt.plat.module.qms.common.data.controller.vo.DataKeyCheckSaveReqVO;
|
||||||
|
import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
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.module.qms.common.data.service.DataKeyCheckService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 数据重复校验")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/data-key-check")
|
||||||
|
@Validated
|
||||||
|
public class DataKeyCheckController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DataKeyCheckService dataKeyCheckService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建数据重复校验")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:data-key-check:create')")
|
||||||
|
public CommonResult<DataKeyCheckRespVO> createDataKeyCheck(@Valid @RequestBody DataKeyCheckSaveReqVO createReqVO) {
|
||||||
|
return success(dataKeyCheckService.createDataKeyCheck(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新数据重复校验")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:data-key-check:update')")
|
||||||
|
public CommonResult<Boolean> updateDataKeyCheck(@Valid @RequestBody DataKeyCheckSaveReqVO updateReqVO) {
|
||||||
|
dataKeyCheckService.updateDataKeyCheck(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除数据重复校验")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:data-key-check:delete')")
|
||||||
|
public CommonResult<Boolean> deleteDataKeyCheck(@RequestParam("id") String id) {
|
||||||
|
dataKeyCheckService.deleteDataKeyCheck(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得数据重复校验")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:data-key-check:query')")
|
||||||
|
public CommonResult<DataKeyCheckRespVO> getDataKeyCheck(@RequestParam("id") String id) {
|
||||||
|
DataKeyCheckDO dataKeyCheck = dataKeyCheckService.getDataKeyCheck(id);
|
||||||
|
return success(BeanUtils.toBean(dataKeyCheck, DataKeyCheckRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得数据重复校验分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:data-key-check:query')")
|
||||||
|
public CommonResult<PageResult<DataKeyCheckRespVO>> getDataKeyCheckPage(@Valid DataKeyCheckPageReqVO pageReqVO) {
|
||||||
|
PageResult<DataKeyCheckDO> pageResult = dataKeyCheckService.getDataKeyCheckPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, DataKeyCheckRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.controller.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
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 DataKeyCheckPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "模块编码")
|
||||||
|
private String moduleCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user