Compare commits
7 Commits
468e939ab1
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 8309ac0f4e | |||
| 45ba58cadb | |||
| eb757e8271 | |||
|
|
11bb57b1a4 | ||
|
|
a536f5c841 | ||
| 607dc05409 | |||
| dd6df68061 |
@@ -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, "样品流程配置不存在");
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -118,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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -263,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)
|
||||||
@@ -395,7 +420,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据分样查询分析任务
|
* 根据分样查询分析任务
|
||||||
* @param businessSubParentSampleIds 分样样id
|
* @param businessSubParentSampleIds 分样样id列表
|
||||||
* @param configAssayMethodId 分析方法
|
* @param configAssayMethodId 分析方法
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
@@ -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<>();
|
||||||
@@ -244,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) {
|
||||||
@@ -383,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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,21 @@ 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;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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")
|
||||||
|
|||||||
@@ -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,8 +40,11 @@ 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::getMethodNameCategory, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||||
.selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode)
|
.selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode)
|
||||||
@@ -49,20 +52,46 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
|||||||
.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 后台管理
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class ReportDocumentAssistService {
|
|||||||
JSONObject extension = bpmFieldExtensions.getJSONObject(i);
|
JSONObject extension = bpmFieldExtensions.getJSONObject(i);
|
||||||
String fieldName = extension.getString("fieldName");
|
String fieldName = extension.getString("fieldName");
|
||||||
String stringValue = extension.getString("stringValue");
|
String stringValue = extension.getString("stringValue");
|
||||||
if(fieldName.equals("creatIWorkFlow") && stringValue.equals("1")){
|
if(fieldName.equalsIgnoreCase("createiworkflow") && stringValue.equals("1")){
|
||||||
createIworkWorkflowFlag = true;
|
createIworkWorkflowFlag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -86,19 +86,6 @@ public class ReportDocumentAssistService {
|
|||||||
if(createIworkWorkflowFlag){
|
if(createIworkWorkflowFlag){
|
||||||
createIWorkflow(entity, docFile);
|
createIWorkflow(entity, docFile);
|
||||||
}
|
}
|
||||||
// todo 判断是否更新pdf
|
|
||||||
|
|
||||||
// if(!updateDocFileFlag && createIworkWorkflowFlag){
|
|
||||||
// ReportDocumentFileDO docFile = reportDocumentFileService.getReportDocumentFile(entity.getId());
|
|
||||||
// createIWorkflow(entity, docFile);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
//更新报告pdf
|
|
||||||
|
|
||||||
// if(updateDocFileFlag){
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -113,8 +100,8 @@ public class ReportDocumentAssistService {
|
|||||||
dto.setSqsj(sdf.format(new Date()));
|
dto.setSqsj(sdf.format(new Date()));
|
||||||
dto.setYyqx("检测报告用印");
|
dto.setYyqx("检测报告用印");
|
||||||
dto.setYysy("检测报告用印");
|
dto.setYysy("检测报告用印");
|
||||||
// dto.setXyywjUrl(docFile.getUrl());
|
dto.setYysx("检测报告用印");
|
||||||
dto.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");
|
dto.setXyywjUrl(docFile.getUrl());
|
||||||
dto.setYwxtdjbh(sequenceUtil.genCode(sequenceKey));
|
dto.setYwxtdjbh(sequenceUtil.genCode(sequenceKey));
|
||||||
return iWorkIntegrationApi.createWorkflow(dto);
|
return iWorkIntegrationApi.createWorkflow(dto);
|
||||||
}
|
}
|
||||||
@@ -152,9 +139,11 @@ public class ReportDocumentAssistService {
|
|||||||
InputStream inputStream = response.bodyStream(); // 关键:返回原始 InputStream
|
InputStream inputStream = response.bodyStream(); // 关键:返回原始 InputStream
|
||||||
|
|
||||||
//尝试从响应头中提取文件名
|
//尝试从响应头中提取文件名
|
||||||
String contentDisposition = response.header("Content-Disposition");
|
// String contentDisposition = response.header("Content-Disposition");
|
||||||
String defaultName = "检测报告.pdf";
|
String documentCode = mainDO.getDocumentCode();
|
||||||
String filename = extractFilename(contentDisposition).orElse(defaultName);
|
if(documentCode == null) documentCode = "";
|
||||||
|
String filename = documentCode + "检测报告.pdf";
|
||||||
|
// String filename = extractFilename(contentDisposition).orElse(defaultName);
|
||||||
//inputStream转byte[]
|
//inputStream转byte[]
|
||||||
byte[] fileBytes = IOUtils.toByteArray(inputStream);
|
byte[] fileBytes = IOUtils.toByteArray(inputStream);
|
||||||
|
|
||||||
@@ -181,14 +170,14 @@ public class ReportDocumentAssistService {
|
|||||||
return BeanUtils.toBean(fileRespDTO, ReportDocumentFileDO.class);
|
return BeanUtils.toBean(fileRespDTO, ReportDocumentFileDO.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<String> extractFilename(String contentDisposition) {
|
// private Optional<String> extractFilename(String contentDisposition) {
|
||||||
if (contentDisposition != null && contentDisposition.contains("filename=")) {
|
// if (contentDisposition != null && contentDisposition.contains("filename=")) {
|
||||||
String filename = contentDisposition.substring(contentDisposition.indexOf("filename=") + 9);
|
// String filename = contentDisposition.substring(contentDisposition.indexOf("filename=") + 9);
|
||||||
filename = filename.replaceAll("\"", "").trim();
|
// filename = filename.replaceAll("\"", "").trim();
|
||||||
return Optional.of(filename);
|
// return Optional.of(filename);
|
||||||
}
|
// }
|
||||||
return Optional.empty();
|
// return Optional.empty();
|
||||||
}
|
// }
|
||||||
|
|
||||||
// private String encodeFilename(String filename) {
|
// private String encodeFilename(String filename) {
|
||||||
// try {
|
// try {
|
||||||
|
|||||||
@@ -28,14 +28,11 @@ import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMa
|
|||||||
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.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 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 jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.scheduling.annotation.Async;
|
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;
|
||||||
@@ -72,8 +69,7 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
@Resource private ConfigUserSignatureService configUserSignatureService;
|
@Resource private ConfigUserSignatureService configUserSignatureService;
|
||||||
@Resource private BusinessSampleEntrustRegistrationService businessSampleEntrustRegistrationService;
|
@Resource private BusinessSampleEntrustRegistrationService businessSampleEntrustRegistrationService;
|
||||||
@Resource private ReportDocumentAssistService reportDocumentAssistService;
|
@Resource private ReportDocumentAssistService reportDocumentAssistService;
|
||||||
|
@Resource private DataKeyCheckService dataKeyCheckService;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 测试异步执行
|
* 测试异步执行
|
||||||
@@ -382,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);
|
||||||
@@ -421,10 +418,24 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
@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));
|
||||||
//todo 幂等性
|
|
||||||
|
|
||||||
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");
|
||||||
@@ -433,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";
|
||||||
@@ -453,7 +461,7 @@ 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("");
|
||||||
@@ -490,8 +498,6 @@ public class ReportDocumentMainServiceImpl implements ReportDocumentMainService,
|
|||||||
return CommonResult.success(ret);
|
return CommonResult.success(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void assembleSignature(String currentActivityId, ReportDocumentMainDO entity){
|
private void assembleSignature(String currentActivityId, ReportDocumentMainDO entity){
|
||||||
if(ObjectUtils.isEmpty(currentActivityId) || "null".equals(currentActivityId))
|
if(ObjectUtils.isEmpty(currentActivityId) || "null".equals(currentActivityId))
|
||||||
return;
|
return;
|
||||||
@@ -517,7 +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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.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 DataKeyCheckRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4480")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "模块编码")
|
||||||
|
@ExcelProperty("模块编码")
|
||||||
|
private String moduleCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 数据重复校验新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class DataKeyCheckSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4480")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "模块编码")
|
||||||
|
private String moduleCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.dal.dataobject;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
/**
|
||||||
|
* 数据重复校验 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("t_dat_ky_chk")
|
||||||
|
@KeySequence("t_dat_ky_chk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class DataKeyCheckDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 模块编码
|
||||||
|
*/
|
||||||
|
@TableField("MDUL_CD")
|
||||||
|
private String moduleCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.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.common.data.controller.vo.DataKeyCheckPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.common.data.dal.dataobject.DataKeyCheckDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据重复校验 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DataKeyCheckMapper extends BaseMapperX<DataKeyCheckDO> {
|
||||||
|
|
||||||
|
default PageResult<DataKeyCheckDO> selectPage(DataKeyCheckPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<DataKeyCheckDO>()
|
||||||
|
.eqIfPresent(DataKeyCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.eqIfPresent(DataKeyCheckDO::getModuleCode, reqVO.getModuleCode())
|
||||||
|
.eqIfPresent(DataKeyCheckDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(DataKeyCheckDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(DataKeyCheckDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
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 jakarta.validation.*;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据重复校验 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
public interface DataKeyCheckService {
|
||||||
|
|
||||||
|
void create(String id, String moduleCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建数据重复校验
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
DataKeyCheckRespVO createDataKeyCheck(@Valid DataKeyCheckSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新数据重复校验
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateDataKeyCheck(@Valid DataKeyCheckSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除数据重复校验
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteDataKeyCheck(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除数据重复校验
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteDataKeyCheckListByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得数据重复校验
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 数据重复校验
|
||||||
|
*/
|
||||||
|
DataKeyCheckDO getDataKeyCheck(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得数据重复校验分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 数据重复校验分页
|
||||||
|
*/
|
||||||
|
PageResult<DataKeyCheckDO> getDataKeyCheckPage(DataKeyCheckPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.zt.plat.module.qms.common.data.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
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.stereotype.Service;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.common.data.dal.mapper.DataKeyCheckMapper;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据重复校验 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class DataKeyCheckServiceImpl implements DataKeyCheckService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DataKeyCheckMapper dataKeyCheckMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(String id, String moduleCode) {
|
||||||
|
DataKeyCheckDO dataKeyCheck = new DataKeyCheckDO();
|
||||||
|
dataKeyCheck.setId(id);
|
||||||
|
dataKeyCheck.setModuleCode(moduleCode);
|
||||||
|
dataKeyCheckMapper.insert(dataKeyCheck);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataKeyCheckRespVO createDataKeyCheck(DataKeyCheckSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
DataKeyCheckDO dataKeyCheck = BeanUtils.toBean(createReqVO, DataKeyCheckDO.class);
|
||||||
|
dataKeyCheckMapper.insert(dataKeyCheck);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(dataKeyCheck, DataKeyCheckRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDataKeyCheck(DataKeyCheckSaveReqVO updateReqVO) {
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
DataKeyCheckDO updateObj = BeanUtils.toBean(updateReqVO, DataKeyCheckDO.class);
|
||||||
|
dataKeyCheckMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDataKeyCheck(String id) {
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
dataKeyCheckMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDataKeyCheckListByIds(List<String> ids) {
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
dataKeyCheckMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataKeyCheckDO getDataKeyCheck(String id) {
|
||||||
|
return dataKeyCheckMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DataKeyCheckDO> getDataKeyCheckPage(DataKeyCheckPageReqVO pageReqVO) {
|
||||||
|
return dataKeyCheckMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.zt.plat.module.qms.core.code;
|
|||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
|
|
||||||
public class SampleEncryptUtil {
|
public class SampleEncryptUtil {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.core.legend.security;
|
package com.zt.plat.module.qms.core.legend.security;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
|
|||||||
@@ -2,11 +2,13 @@ package com.zt.plat.module.qms.core.qlexpress.cmp;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import com.ql.util.express.DefaultContext;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
import com.ql.util.express.ExpressRunner;
|
import com.alibaba.qlexpress4.QLOptions;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -19,7 +21,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
public class AllowanceCalculatorComponent {
|
public class AllowanceCalculatorComponent {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ExpressRunner expressRunner;
|
private Express4Runner express4Runner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算允差值:支持原生线性公式 和 Express 自定义公式混合模式
|
* 计算允差值:支持原生线性公式 和 Express 自定义公式混合模式
|
||||||
@@ -80,11 +82,12 @@ public class AllowanceCalculatorComponent {
|
|||||||
* 使用 Express 执行自定义公式
|
* 使用 Express 执行自定义公式
|
||||||
*/
|
*/
|
||||||
private BigDecimal evaluateCustomFormula(String formula, BigDecimal xValue, int scale) {
|
private BigDecimal evaluateCustomFormula(String formula, BigDecimal xValue, int scale) {
|
||||||
DefaultContext<String, Object> context = new DefaultContext<>();
|
Map<String, Object> context = new HashMap<>();
|
||||||
context.put("X", xValue); // 用户公式中使用 X 作为变量名
|
context.put("X", xValue); // 用户公式中使用 X 作为变量名
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Object result = expressRunner.execute(formula, context, null, true, false);
|
// Object result = expressRunner.execute(formula, context, null, true, false);
|
||||||
|
Object result = express4Runner.execute(formula, context, QLOptions.builder().precise(true).build());
|
||||||
|
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new RuntimeException("Express 公式返回结果为 null");
|
throw new RuntimeException("Express 公式返回结果为 null");
|
||||||
|
|||||||
@@ -3,16 +3,19 @@ package com.zt.plat.module.qms.core.qlexpress.config;
|
|||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
import com.ql.util.express.ExpressRunner;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
|
import com.alibaba.qlexpress4.InitOptions;
|
||||||
|
import com.alibaba.qlexpress4.security.QLSecurityStrategy;
|
||||||
import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven;
|
import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class QlExpressRuleEngineConfig {
|
public class QlExpressRuleEngineConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ExpressRunner expressRunner() {
|
public Express4Runner expressRunner() {
|
||||||
//需要高精度计算支持
|
//兼容 3 的行为,则在新建 Express4Runner 时, 要将安全策略设置为 “开放”
|
||||||
ExpressRunner expressRunner = new ExpressRunner(true, false);
|
InitOptions initOptions = InitOptions.builder().securityStrategy(QLSecurityStrategy.open()).build();
|
||||||
|
Express4Runner expressRunner = new Express4Runner(initOptions);
|
||||||
expressRunner.addFunction("roundToScale", new RoundToScaleHalfEven());
|
expressRunner.addFunction("roundToScale", new RoundToScaleHalfEven());
|
||||||
return expressRunner;
|
return expressRunner;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,18 +3,20 @@ package com.zt.plat.module.qms.core.qlexpress.function;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
import com.ql.util.express.Operator;
|
import com.alibaba.qlexpress4.runtime.Parameters;
|
||||||
|
import com.alibaba.qlexpress4.runtime.QContext;
|
||||||
|
import com.alibaba.qlexpress4.runtime.function.CustomFunction;
|
||||||
|
|
||||||
public class RoundToScaleHalfEven extends Operator {
|
|
||||||
|
public class RoundToScaleHalfEven implements CustomFunction {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object executeInner(Object[] list) throws Exception {
|
public Object call(QContext qContext, Parameters parameters) throws Throwable {
|
||||||
if (list.length != 2) {
|
if (parameters.size() != 2) {
|
||||||
throw new Exception("roundToScale函数需要2个参数:数值和小数位数");
|
throw new Exception("roundToScale函数需要2个参数:数值和小数位数");
|
||||||
}
|
}
|
||||||
|
double value = Double.parseDouble(parameters.get(0).get().toString());
|
||||||
double value = Double.parseDouble(list[0].toString());
|
int scale = Integer.parseInt(parameters.get(1).get().toString());
|
||||||
int scale = Integer.parseInt(list[1].toString());
|
|
||||||
|
|
||||||
BigDecimal bd = BigDecimal.valueOf(value);
|
BigDecimal bd = BigDecimal.valueOf(value);
|
||||||
bd = bd.setScale(scale, RoundingMode.HALF_EVEN);
|
bd = bd.setScale(scale, RoundingMode.HALF_EVEN);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.iot.tcpserver;
|
package com.zt.plat.module.qms.iot.tcpserver;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
import tech.zzjc.tio.core.ChannelContext;
|
import tech.zzjc.tio.core.ChannelContext;
|
||||||
import tech.zzjc.tio.core.Tio;
|
import tech.zzjc.tio.core.Tio;
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ import com.zt.plat.module.qms.iot.tcpserver.handler.IotDataHander;
|
|||||||
import com.zt.plat.module.qms.iot.tcpserver.publisher.BalanceDataPublisher;
|
import com.zt.plat.module.qms.iot.tcpserver.publisher.BalanceDataPublisher;
|
||||||
import com.fhs.common.spring.SpringContextUtil;
|
import com.fhs.common.spring.SpringContextUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.apache.commons.lang.math.NumberUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.commons.lang3.math.NumberUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import tech.zzjc.tio.cluster.TioClusterConfig;
|
import tech.zzjc.tio.cluster.TioClusterConfig;
|
||||||
import tech.zzjc.tio.cluster.TioClusterVo;
|
import tech.zzjc.tio.cluster.TioClusterVo;
|
||||||
@@ -81,7 +82,7 @@ public class IotDeviceBalanceHandler implements IotDataHander {
|
|||||||
String[] dataArray = analysisData(data, weightUnit);
|
String[] dataArray = analysisData(data, weightUnit);
|
||||||
weightData = dataArray[0];
|
weightData = dataArray[0];
|
||||||
weightUnit = dataArray[1];
|
weightUnit = dataArray[1];
|
||||||
if (!NumberUtils.isNumber(weightData)) {
|
if (!NumberUtils.isParsable(weightData)) {
|
||||||
log.error("{},天平接收到的数据不正确!接收到的数据:{} 16进制:{}", realClient, data, IotUtils.bytesToHex(data.getBytes("UTF-8")));
|
log.error("{},天平接收到的数据不正确!接收到的数据:{} 16进制:{}", realClient, data, IotUtils.bytesToHex(data.getBytes("UTF-8")));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
|||||||
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.ConfigSubSampleMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
@@ -115,7 +116,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
|||||||
List<Long> configSubSampleIdList = list.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> configSubSampleIdList = list.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());
|
||||||
|
|
||||||
//分析任务id列表
|
//分析任务id列表
|
||||||
List<Long> businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> businessAssayTaskDataIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
@@ -135,7 +136,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
|||||||
//分析人员信息
|
//分析人员信息
|
||||||
AdminUserRespDTO user = userList.stream().filter(f -> f.getId().equals(m.getAssayOperatorId())).findFirst().orElse(null);
|
AdminUserRespDTO user = userList.stream().filter(f -> f.getId().equals(m.getAssayOperatorId())).findFirst().orElse(null);
|
||||||
//子样配置信息
|
//子样配置信息
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(m.getConfigSubSampleId())).findFirst().orElse(null);
|
ConfigSubSampleMethodExtendRespVO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getConfigSubSampleId().equals(m.getConfigSubSampleId())).findFirst().orElse(null);
|
||||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||||
//当前检测项目列表
|
//当前检测项目列表
|
||||||
List<BusinessAssayProjectDataExtendRespVO> currentBusinessAssayProjectDataList = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(m.getId())).collect(Collectors.toList());
|
List<BusinessAssayProjectDataExtendRespVO> currentBusinessAssayProjectDataList = businessAssayProjectDataList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(m.getId())).collect(Collectors.toList());
|
||||||
@@ -196,7 +197,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
|||||||
//子样配置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());
|
||||||
@@ -210,7 +211,7 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService {
|
|||||||
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);
|
||||||
|
|||||||
@@ -19,10 +19,17 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
|||||||
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.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.BusinessQCManagementDataDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParameterDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO;
|
||||||
@@ -61,6 +68,18 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementDataMapper businessQCManagementDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCManagementProjectDataMapper businessQCManagementProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCCoefficientDataMapper businessQCCoefficientDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessQCCoefficientParameterDataMapper businessQCCoefficientParameterDataMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ConfigXRFLineCustomRespVO> getXrfLineList(String deviceNo) {
|
public List<ConfigXRFLineCustomRespVO> getXrfLineList(String deviceNo) {
|
||||||
List<ConfigXRFLineDO> list = configXRFLineMapper.selectByDeviceNo(deviceNo);
|
List<ConfigXRFLineDO> list = configXRFLineMapper.selectByDeviceNo(deviceNo);
|
||||||
@@ -82,6 +101,9 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
//获取荧光样品id列表
|
//获取荧光样品id列表
|
||||||
List<String> sampleIdList = xrfDeviceSampleList.stream().map(XRFDeviceSampleReqVO::getSampleId).collect(Collectors.toList());
|
List<String> sampleIdList = xrfDeviceSampleList.stream().map(XRFDeviceSampleReqVO::getSampleId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
//获取荧光样品编号列表
|
||||||
|
List<String> sampleCodeList = xrfDeviceSampleList.stream().map(m -> m.getSampleCode()).collect(Collectors.toList());
|
||||||
|
|
||||||
//查询数据库是否已保存了荧光数据
|
//查询数据库是否已保存了荧光数据
|
||||||
BusinessXRFDataReqVO existXRFDataSearch = new BusinessXRFDataReqVO();
|
BusinessXRFDataReqVO existXRFDataSearch = new BusinessXRFDataReqVO();
|
||||||
existXRFDataSearch.setDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
existXRFDataSearch.setDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
||||||
@@ -96,8 +118,19 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
//根据设备编号查询荧光元素配置
|
//根据设备编号查询荧光元素配置
|
||||||
List<ConfigXRFProjectDO> conYgElementList = configXRFProjectMapper.selectByDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
List<ConfigXRFProjectDO> conYgElementList = configXRFProjectMapper.selectByDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
||||||
|
|
||||||
|
//根据样品编号及分析方法类型,获取检测任务数据
|
||||||
|
List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||||
|
|
||||||
|
//管理样和标准样
|
||||||
|
List<BusinessQCManagementDataDO> businessQCManagementDataList = businessQCManagementDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||||
|
|
||||||
|
//空白样和标样
|
||||||
|
// List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(sampleCodeList, "xshxyggpf");
|
||||||
|
|
||||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = new ArrayList<>();
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = new ArrayList<>();
|
||||||
List<BusinessAssayProjectDataDO> busElementValueList = new ArrayList<>();
|
List<BusinessAssayProjectDataDO> busElementValueList = new ArrayList<>();
|
||||||
|
List<BusinessQCManagementProjectDataDO> busQcManageElementValueList = new ArrayList<>();
|
||||||
|
// List<BusinessQCCoefficientParameterDataDO> busQccParameterValueList = new ArrayList<>();
|
||||||
List<BusinessXRFDataDO> busYgDataList = new ArrayList<>();
|
List<BusinessXRFDataDO> busYgDataList = new ArrayList<>();
|
||||||
BusinessXRFDataDO busYgData = null;
|
BusinessXRFDataDO busYgData = null;
|
||||||
for (XRFDeviceSampleReqVO ygDeviceSample : xrfDeviceSampleList) {
|
for (XRFDeviceSampleReqVO ygDeviceSample : xrfDeviceSampleList) {
|
||||||
@@ -127,12 +160,33 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
|
|
||||||
|
|
||||||
//处理匹配
|
//处理匹配
|
||||||
|
//a. 分析样
|
||||||
List<BusinessAssayProjectDataExtendRespVO> tempBusElementValueList = new ArrayList<>();
|
List<BusinessAssayProjectDataExtendRespVO> tempBusElementValueList = new ArrayList<>();
|
||||||
BusinessAssayTaskDataExtendRespVO businessAssayTaskData = businessAssayTaskDataMapper.selectBySampleCode(ygDeviceSample.getSampleCode());
|
List<BusinessAssayTaskDataExtendRespVO> currBusinessAssayTaskDataList = businessAssayTaskDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleAssayCode())).collect(Collectors.toList());
|
||||||
if (businessAssayTaskData != null) {
|
if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) {
|
||||||
List<BusinessAssayProjectDataExtendRespVO> busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) {
|
||||||
tempBusElementValueList.addAll(busElementValues);
|
List<BusinessAssayProjectDataExtendRespVO> busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||||
|
tempBusElementValueList.addAll(busElementValues);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//b. 管理样和标准样
|
||||||
|
List<BusinessQCManagementProjectDataDO> tempBusinessQCManagementProjectDataList = new ArrayList<>();
|
||||||
|
List<BusinessQCManagementDataDO> currBusinessQCManagementDataList = businessQCManagementDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleCode())).collect(Collectors.toList());
|
||||||
|
if (currBusinessQCManagementDataList != null && currBusinessQCManagementDataList.size() > 0) {
|
||||||
|
for (BusinessQCManagementDataDO businessQCManagementData : currBusinessQCManagementDataList) {
|
||||||
|
List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataId(businessQCManagementData.getId());
|
||||||
|
tempBusinessQCManagementProjectDataList.addAll(businessQCManagementProjectDataList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//c. 空白样和标样
|
||||||
|
// List<BusinessQCCoefficientParameterDataDO> tempBusinessQCCoefficientParameterDataList = new ArrayList<>();
|
||||||
|
// List<BusinessQCCoefficientDataDO> currBusinessQCCoefficientDataList = businessQCCoefficientDataList.stream().filter(f -> ygDeviceSample.getSampleCode().equals(f.getSampleCode())).collect(Collectors.toList());
|
||||||
|
// if (currBusinessQCCoefficientDataList != null && currBusinessQCCoefficientDataList.size() > 0) {
|
||||||
|
// for (BusinessQCCoefficientDataDO businessQCCoefficientDataDO : currBusinessQCCoefficientDataList) {
|
||||||
|
// List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList = businessQCCoefficientParameterDataMapper.selectByBusinessQCCoefficientDataId(businessQCCoefficientDataDO.getId());
|
||||||
|
// tempBusinessQCCoefficientParameterDataList.addAll(businessQCCoefficientParameterDataList);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//分析元素
|
//分析元素
|
||||||
for (XRFDeviceSampleProjectReqVO ygDeviceSampleElement : sampleElements) {
|
for (XRFDeviceSampleProjectReqVO ygDeviceSampleElement : sampleElements) {
|
||||||
@@ -143,8 +197,6 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询是否有特殊转换率
|
//查询是否有特殊转换率
|
||||||
// QmsConYgConverRate conYgConverRate = conYgConverRateService.getOne(Wrappers.<QmsConYgConverRate>query().lambda().eq(QmsConYgConverRate::getDeviceNo, ygDeviceSample.getDeviceNo())
|
|
||||||
// .eq(QmsConYgConverRate::getLineName, ygDeviceSample.getLineName()).eq(QmsConYgConverRate::getElementName, ygDeviceSampleElement.getElementName()));
|
|
||||||
ConfigXRFConversionRateDO conYgConverRate = configXRFConversionRateMapper.selectBy(ygDeviceSample.getDeviceNo(), ygDeviceSample.getLineName(), ygDeviceSampleElement.getXrfProjectName());
|
ConfigXRFConversionRateDO conYgConverRate = configXRFConversionRateMapper.selectBy(ygDeviceSample.getDeviceNo(), ygDeviceSample.getLineName(), ygDeviceSampleElement.getXrfProjectName());
|
||||||
|
|
||||||
ConfigXRFProjectDO conYgElement = null;
|
ConfigXRFProjectDO conYgElement = null;
|
||||||
@@ -171,34 +223,66 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
conYgElementDataType = conYgElement.getDecimalPosition();
|
conYgElementDataType = conYgElement.getDecimalPosition();
|
||||||
}
|
}
|
||||||
Long elementId = conYgElement.getDictionaryProjectId();
|
Long elementId = conYgElement.getDictionaryProjectId();
|
||||||
BusinessAssayProjectDataExtendRespVO busElementValue = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).findFirst().orElse(null);
|
List<BusinessAssayProjectDataExtendRespVO> currBusElementValueList = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList());
|
||||||
if (busElementValue != null) {
|
String symbol = "=";
|
||||||
//化验数据小数精度四舍六入五单双
|
String minimumLimitValue = "";
|
||||||
if("decimal".equals(busElementValue.getDataType())) {
|
if (currBusElementValueList != null && currBusElementValueList.size() > 0) {
|
||||||
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString());
|
for (BusinessAssayProjectDataExtendRespVO busElementValue : currBusElementValueList) {
|
||||||
} else {
|
//化验数据小数精度四舍六入五单双
|
||||||
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
if("decimal".equals(busElementValue.getDataType())) {
|
||||||
}
|
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString());
|
||||||
busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue());
|
if (elementValue.compareTo(new BigDecimal(busElementValue.getMinimumLimitValue())) < 0) {
|
||||||
busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class));
|
symbol = "<";
|
||||||
|
minimumLimitValue = busElementValue.getMinimumLimitValue();
|
||||||
|
busElementValue.setValue(busElementValue.getMinimumLimitValue());
|
||||||
|
}
|
||||||
|
busElementValue.setSymbol(symbol);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
||||||
|
}
|
||||||
|
busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue());
|
||||||
|
busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<BusinessQCManagementProjectDataDO> currBusQcElementValueList = tempBusinessQCManagementProjectDataList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList());
|
||||||
|
if (currBusQcElementValueList != null && currBusQcElementValueList.size() > 0) {
|
||||||
|
for (BusinessQCManagementProjectDataDO busElementValue : currBusQcElementValueList) {
|
||||||
|
//化验数据小数精度四舍六入五单双
|
||||||
|
if("decimal".equals(busElementValue.getDataType())) {
|
||||||
|
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString());
|
||||||
|
ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectMapper.selectById(busElementValue.getConfigAssayMethodProjectId());
|
||||||
|
if (elementValue.compareTo(new BigDecimal(configAssayMethodProjectDO.getMinimumLimitValue())) < 0) {
|
||||||
|
symbol = "<";
|
||||||
|
minimumLimitValue = configAssayMethodProjectDO.getMinimumLimitValue();
|
||||||
|
busElementValue.setValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
|
}
|
||||||
|
busElementValue.setSymbol(symbol);
|
||||||
|
} else {
|
||||||
|
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
||||||
|
}
|
||||||
|
busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue());
|
||||||
|
busQcManageElementValueList.add(busElementValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
||||||
reportFieldValueData.setFieldName(conYgElement.getSaveColumn());
|
reportFieldValueData.setFieldName(conYgElement.getSaveColumn());
|
||||||
reportFieldValueData.setFieldValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
reportFieldValueData.setFieldValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
||||||
reportFieldValueData.setDecimalPosition(ygDeviceSampleElement.getValueDecimals());
|
reportFieldValueData.setDecimalPosition(ygDeviceSampleElement.getValueDecimals());
|
||||||
reportFieldValueData.setMathSymbol("=");
|
reportFieldValueData.setMathSymbol(symbol);
|
||||||
|
if ("<".equals(symbol)) {
|
||||||
|
reportFieldValueData.setFieldValue(minimumLimitValue);
|
||||||
|
}
|
||||||
reportFieldValueData.setUnit(ygDeviceSampleElement.getXrfProjectUnit());
|
reportFieldValueData.setUnit(ygDeviceSampleElement.getXrfProjectUnit());
|
||||||
assayDataJson.put(conYgElement.getSaveColumn(), reportFieldValueData);
|
assayDataJson.put(conYgElement.getSaveColumn(), reportFieldValueData);
|
||||||
|
|
||||||
// if(conYgElementDataType != null && conYgElementDataType.intValue() > -1) {
|
|
||||||
// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue.setScale(conYgElementDataType, BigDecimal.ROUND_HALF_EVEN).toPlainString());//数据格式化-四舍六入五单双
|
|
||||||
// } else {
|
|
||||||
// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//循环元素修改流程节点
|
//循环元素修改
|
||||||
for (BusinessAssayProjectDataExtendRespVO busElementValue : tempBusElementValueList) {
|
for (BusinessAssayProjectDataExtendRespVO busElementValue : tempBusElementValueList) {
|
||||||
boolean match = busElementValueList.stream().anyMatch(m -> m.getId().equals(busElementValue.getId()));
|
boolean match = busElementValueList.stream().anyMatch(m -> m.getId().equals(busElementValue.getId()));
|
||||||
if (!match) {//已经添加过的,不再添加
|
if (!match) {//已经添加过的,不再添加
|
||||||
@@ -209,14 +293,23 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
//设置分析数据
|
//设置分析数据
|
||||||
busYgData.setAssayData(assayDataJson.toJSONString());
|
busYgData.setAssayData(assayDataJson.toJSONString());
|
||||||
|
|
||||||
if (businessAssayTaskData != null) {
|
if (currBusinessAssayTaskDataList != null && currBusinessAssayTaskDataList.size() > 0) {
|
||||||
busYgData.setIsMatched(QmsCommonConstant.YES);
|
for (BusinessAssayTaskDataExtendRespVO businessAssayTaskData : currBusinessAssayTaskDataList) {
|
||||||
busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId());
|
busYgData.setIsMatched(QmsCommonConstant.YES);
|
||||||
busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId());
|
busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId());
|
||||||
busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId());
|
busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId());
|
||||||
busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId());
|
||||||
businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class));
|
busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||||
|
businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (currBusinessQCManagementDataList != null && currBusinessQCManagementDataList.size() > 0) {
|
||||||
|
for (BusinessQCManagementDataDO businessQCManagementData : currBusinessQCManagementDataList) {
|
||||||
|
busYgData.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
||||||
|
busYgData.setIsMatched(QmsCommonConstant.YES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
busYgDataList.add(busYgData);
|
busYgDataList.add(busYgData);
|
||||||
}
|
}
|
||||||
@@ -227,22 +320,25 @@ public class XRFDataServiceImpl implements XRFDataService {
|
|||||||
} else {
|
} else {
|
||||||
conYgLine.setLastSynchronousDataTime(maxSampleTime);
|
conYgLine.setLastSynchronousDataTime(maxSampleTime);
|
||||||
}
|
}
|
||||||
//更新配置时间
|
//更新荧光线配置时间
|
||||||
configXRFLineMapper.updateById(conYgLine);
|
configXRFLineMapper.updateById(conYgLine);
|
||||||
if (busYgDataList.size() > 0) {
|
if (busYgDataList.size() > 0) {
|
||||||
|
|
||||||
//保存荧光数据
|
//保存荧光数据
|
||||||
businessXRFDataMapper.insertBatch(busYgDataList);
|
businessXRFDataMapper.insertBatch(busYgDataList);
|
||||||
|
|
||||||
//更新分样子样
|
|
||||||
// if(businessAssayTaskDataDOs.size() > 0) {
|
|
||||||
// busSubCsampleService.updateBatchById(businessAssayTaskDataDOs);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//更新分析结果
|
//更新分析结果
|
||||||
if (busElementValueList.size() > 0) {
|
if (busElementValueList.size() > 0) {
|
||||||
businessAssayProjectDataMapper.updateBatch(busElementValueList);
|
businessAssayProjectDataMapper.updateBatch(busElementValueList);
|
||||||
}
|
}
|
||||||
|
//荧光管理样和标准样
|
||||||
|
if (busQcManageElementValueList.size() > 0) {
|
||||||
|
businessQCManagementProjectDataMapper.updateBatch(busQcManageElementValueList);
|
||||||
|
}
|
||||||
|
//荧光空白样和标样
|
||||||
|
// if (busQccParameterValueList.size() > 0) {
|
||||||
|
// businessQCCoefficientParameterDataMapper.updateBatch(busQccParameterValueList);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,45 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<select id="selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId" resultType="com.zt.plat.module.qms.business.bus.controller.vo.AssayMethodProjectRespVO">
|
||||||
|
SELECT
|
||||||
|
tbapd.DIC_PRJ_ID dictionaryProjectId,
|
||||||
|
tdp.NAME AS dictionaryProjectName,
|
||||||
|
tdp.SMPL_NAME AS dictionaryProjectSimpleName,
|
||||||
|
tdp.SHW_NAME AS dictionaryProjectShowName,
|
||||||
|
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||||
|
tcam.NAME AS configAssayMethodName,
|
||||||
|
tcam.MTHD_NAME_CTGR AS configAssayMethodNameAndCategory,
|
||||||
|
tcamp.SRT_NO
|
||||||
|
FROM
|
||||||
|
T_BSN_ASY_PRJ_DAT tbapd
|
||||||
|
LEFT JOIN T_BSN_ASY_TSK_DAT tbatd ON
|
||||||
|
tbapd.BSN_ASY_TSK_DAT_ID = tbatd.ID
|
||||||
|
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||||
|
tbatd.CFG_ASY_MTHD_ID = tcam.ID
|
||||||
|
LEFT JOIN T_CFG_ASY_MTHD_PRJ tcamp ON
|
||||||
|
tbapd.CFG_ASY_MTHD_PRJ_ID = tcamp.ID
|
||||||
|
LEFT JOIN T_DIC_PRJ tdp ON
|
||||||
|
tbapd.DIC_PRJ_ID = tdp.ID
|
||||||
|
WHERE
|
||||||
|
tbapd.DELETED = 0
|
||||||
|
AND tbapd.IS_ENBD = 1
|
||||||
|
AND tbatd.DELETED = 0
|
||||||
|
AND tbatd.IS_ASN_TSKD = 0
|
||||||
|
AND tbatd.BSN_SB_SMP_ID IN
|
||||||
|
<foreach collection="businessSubSampleIdList" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND tbatd.CFG_ASY_MTHD_ID = #{configAssayMethodId}
|
||||||
|
GROUP BY
|
||||||
|
tbapd.DIC_PRJ_ID,
|
||||||
|
tdp.NAME,
|
||||||
|
tdp.SMPL_NAME,
|
||||||
|
tdp.SHW_NAME,
|
||||||
|
tbatd.CFG_ASY_MTHD_ID,
|
||||||
|
tcam.NAME,
|
||||||
|
tcam.MTHD_NAME_CTGR,
|
||||||
|
tcamp.SRT_NO
|
||||||
|
ORDER BY tcamp.SRT_NO ASC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -128,6 +128,8 @@
|
|||||||
tbss.SMP_FLW_NDE_TM AS sampleFlowNodeTime,
|
tbss.SMP_FLW_NDE_TM AS sampleFlowNodeTime,
|
||||||
tbatd.BSN_SB_SMP_ID AS businessSubSampleId,
|
tbatd.BSN_SB_SMP_ID AS businessSubSampleId,
|
||||||
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||||
|
tcam.NAME AS configAssayMethodName,
|
||||||
|
tcam.MTHD_NAME_CTGR AS configAssayMethodNameAndCategory,
|
||||||
tbatd.ASY_TP AS assayType,
|
tbatd.ASY_TP AS assayType,
|
||||||
tbatd.ASY_PRJ AS assayProject,
|
tbatd.ASY_PRJ AS assayProject,
|
||||||
tbatd.ASY_DEPT_ID AS assayDepartmentId,
|
tbatd.ASY_DEPT_ID AS assayDepartmentId,
|
||||||
@@ -136,6 +138,8 @@
|
|||||||
T_BSN_ASY_TSK_DAT tbatd
|
T_BSN_ASY_TSK_DAT tbatd
|
||||||
LEFT JOIN T_BSN_SB_SMP tbss ON
|
LEFT JOIN T_BSN_SB_SMP tbss ON
|
||||||
tbatd.BSN_SB_SMP_ID = tbss.ID
|
tbatd.BSN_SB_SMP_ID = tbss.ID
|
||||||
|
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||||
|
tbatd.CFG_ASY_MTHD_ID = tcam.ID
|
||||||
WHERE
|
WHERE
|
||||||
tbatd.DELETED = 0
|
tbatd.DELETED = 0
|
||||||
AND tbatd.IS_ASN_TSKD = 0
|
AND tbatd.IS_ASN_TSKD = 0
|
||||||
@@ -157,15 +161,23 @@
|
|||||||
<if test="reqVO.sampleReturnCode != null and reqVO.sampleReturnCode != ''">
|
<if test="reqVO.sampleReturnCode != null and reqVO.sampleReturnCode != ''">
|
||||||
AND tbss.SMP_RTN_CD = #{reqVO.sampleReturnCode}
|
AND tbss.SMP_RTN_CD = #{reqVO.sampleReturnCode}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY tbss.ID ,
|
<if test="reqVO.sampleName != null and reqVO.sampleName != ''">
|
||||||
tbss.SMP_NAME ,
|
AND tbss.SMP_NAME like '%' || #{reqVO.sampleName} || '%'
|
||||||
tbss.SMP_CD ,
|
</if>
|
||||||
tbss.SMP_ASY_CD ,
|
<if test="reqVO.configAssayMethodNameAndCategory != null and reqVO.configAssayMethodNameAndCategory != ''">
|
||||||
tbss.SMP_RTN_CD ,
|
AND tcam.MTHD_NAME_CTGR like '%' || #{reqVO.configAssayMethodNameAndCategory} || '%'
|
||||||
|
</if>
|
||||||
|
GROUP BY tbss.ID,
|
||||||
|
tbss.SMP_NAME,
|
||||||
|
tbss.SMP_CD,
|
||||||
|
tbss.SMP_ASY_CD,
|
||||||
|
tbss.SMP_RTN_CD,
|
||||||
tbss.SMP_FLW_NDE_TM,
|
tbss.SMP_FLW_NDE_TM,
|
||||||
tbatd.BSN_SB_SMP_ID ,
|
tbatd.BSN_SB_SMP_ID,
|
||||||
tbatd.CFG_ASY_MTHD_ID ,
|
tbatd.CFG_ASY_MTHD_ID,
|
||||||
tbatd.ASY_TP ,
|
tcam.NAME,
|
||||||
|
tcam.MTHD_NAME_CTGR,
|
||||||
|
tbatd.ASY_TP,
|
||||||
tbatd.ASY_PRJ,
|
tbatd.ASY_PRJ,
|
||||||
tbatd.ASY_DEPT_ID,
|
tbatd.ASY_DEPT_ID,
|
||||||
tbatd.ASY_DEPT_NAME
|
tbatd.ASY_DEPT_NAME
|
||||||
|
|||||||
@@ -40,7 +40,9 @@ public final class CryptoSignatureUtils {
|
|||||||
random.setSeed(password.getBytes(StandardCharsets.UTF_8));
|
random.setSeed(password.getBytes(StandardCharsets.UTF_8));
|
||||||
kg.init(128, random);
|
kg.init(128, random);
|
||||||
SecretKey secretKey = kg.generateKey();
|
SecretKey secretKey = kg.generateKey();
|
||||||
return new SecretKeySpec(secretKey.getEncoded(), "AES");
|
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getEncoded(), "AES");
|
||||||
|
String keyStr = new String(secretKeySpec.getEncoded(), StandardCharsets.UTF_8);
|
||||||
|
return secretKeySpec;
|
||||||
} catch (NoSuchAlgorithmException ex) {
|
} catch (NoSuchAlgorithmException ex) {
|
||||||
throw new IllegalStateException("Failed to generate AES secret key", ex);
|
throw new IllegalStateException("Failed to generate AES secret key", ex);
|
||||||
}
|
}
|
||||||
@@ -99,6 +101,7 @@ public final class CryptoSignatureUtils {
|
|||||||
}
|
}
|
||||||
} else if (ENCRYPT_TYPE_DES.equalsIgnoreCase(type)) {
|
} else if (ENCRYPT_TYPE_DES.equalsIgnoreCase(type)) {
|
||||||
byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
|
byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
|
||||||
|
String keyStr = new String(keyBytes, StandardCharsets.UTF_8);
|
||||||
byte[] desKey = new byte[8];
|
byte[] desKey = new byte[8];
|
||||||
System.arraycopy(keyBytes, 0, desKey, 0, Math.min(keyBytes.length, desKey.length));
|
System.arraycopy(keyBytes, 0, desKey, 0, Math.min(keyBytes.length, desKey.length));
|
||||||
byte[] decoded = decodeBase64Ciphertext(ciphertext);
|
byte[] decoded = decodeBase64Ciphertext(ciphertext);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public class DatabusApiInvocationExample {
|
|||||||
private static final String APP_SECRET = "tjDKCUGNEDR9yNgbxIsvtXsRMuQK+tj1HNEMpgjJOPU=";
|
private static final String APP_SECRET = "tjDKCUGNEDR9yNgbxIsvtXsRMuQK+tj1HNEMpgjJOPU=";
|
||||||
private static final String ENCRYPTION_TYPE = CryptoSignatureUtils.ENCRYPT_TYPE_AES;
|
private static final String ENCRYPTION_TYPE = CryptoSignatureUtils.ENCRYPT_TYPE_AES;
|
||||||
private static final String TARGET_API = "http://172.16.46.62:30081/admin-api/databus/api/portal";
|
private static final String TARGET_API = "http://172.16.46.62:30081/admin-api/databus/api/portal";
|
||||||
|
// private static final String TARGET_API = "https://jygk.chncopper.com:30078/admin-api/databus/api/portal";
|
||||||
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(5)).build();
|
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(5)).build();
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
private static final PrintStream OUT = buildConsolePrintStream();
|
private static final PrintStream OUT = buildConsolePrintStream();
|
||||||
@@ -37,11 +38,16 @@ public class DatabusApiInvocationExample {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
OUT.println("=== GET 请求示例 ===");
|
// OUT.println("=== GET 请求示例 ===");
|
||||||
// executeGetExample();
|
// executeGetExample();
|
||||||
// OUT.println();
|
// OUT.println();
|
||||||
// OUT.println("=== POST 请求示例 ===");
|
// OUT.println("=== POST 请求示例 ===");
|
||||||
executePostExample();
|
// executePostExample();
|
||||||
|
String encodeStr = "SFqGUDidGgWMWvcU6Qy8SNvyhESvZV9uViIz6lisYB9A1qvKrhotX0JXLrcgcL057d+ZVMDJxngw+UvQ5F6UnYXeDGtyAr/ZXKqSXApygdPYZQPwbj1hzUAZhTw/oHUc7ucU59jT5N1TYW/4jJPzmnMU28D0gXrRVDUmX/SNfPlpN9YvPIobzMeoXZlNkFdURZzIX9aQbhgRNXZHruGQGcqDLePkSh01oq9D+i65DNWQGAYDTGfdVTXuGJw6UY4fQJsn7/5HxZoVWKXgKwAmWo/+KwUG5AVD1BcfK7avYLXAcmnJJftFwZvB08eoe7/ySp4ytv1iSHYxUGZ8YNbUS/wIA3pVhfJHWz1Ko0t3nBbxBtLAOmj2jNzjxU/TI/g1n5dtX8B2OoiMZUHHJaHNEMqmULfLILZE7oMGNbRAh1T0gZcU+rkFfm/995ZnTUmaCCKrKZAs5p0FPqhXRf/ZchN0G6opd9hBE+hJY7v92uDqK5RkgomRIAFcf73d7pnIXTgKHMtLLn7r298+A1kKgyH28wGS6pqGfvdZ1yHqbb5zFNvA9IF60VQ1Jl/0jXz5CJBXy+d+QqX/s06uXDzZ2UWcyF/WkG4YETV2R67hkBnKgy3j5EodNaKvQ/ouuQzVkBgGA0xn3VU17hicOlGOH0CbJ+/+R8WaFVil4CsAJlqjj0mF1g5XV34ddfgOcGFYdcKvMDA+YRf1zK8oGRwGekqeMrb9Ykh2MVBmfGDW1EueSNggsyxhSQWEnThMCB2stDi4frs5kanGFhC7er/L9fTD1leamk8i04Wy5eC0PALKplC3yyC2RO6DBjW0QIdU9IGXFPq5BX5v/feWZ01JmggiqymQLOadBT6oV0X/2XIimcN9BgTUX2en4UohmG1NAjFVyWRqx4KmhX10IRwB47CxOMt1NRhwz7UCTqb7fn60/OcolT4ljcD7SuLCj5zwNCt3cQ4eX+mpPecoUtsPdA==";
|
||||||
|
|
||||||
|
String decrypt = tryDecrypt(encodeStr);
|
||||||
|
String aa = normalizePotentialMojibake(decrypt);
|
||||||
|
OUT.println(decrypt);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void executeGetExample() throws Exception {
|
private static void executeGetExample() throws Exception {
|
||||||
|
|||||||
@@ -2,39 +2,51 @@ package com.zt.plat.module.qms;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import com.ql.util.express.DefaultContext;
|
import com.alibaba.qlexpress4.Express4Runner;
|
||||||
import com.ql.util.express.ExpressRunner;
|
import com.alibaba.qlexpress4.InitOptions;
|
||||||
import com.ql.util.express.IExpressContext;
|
import com.alibaba.qlexpress4.QLOptions;
|
||||||
|
import com.alibaba.qlexpress4.security.QLSecurityStrategy;
|
||||||
import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven;
|
import com.zt.plat.module.qms.core.qlexpress.function.RoundToScaleHalfEven;
|
||||||
|
|
||||||
public class QLExpressRunnerTest {
|
public class QLExpressRunnerTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void roundToScaleTest() throws Exception {
|
void roundToScaleTest() throws Exception {
|
||||||
ExpressRunner expressRunner = new ExpressRunner(true, false);
|
// ExpressRunner expressRunner = new ExpressRunner(true, false);
|
||||||
expressRunner.addFunction("roundToScale", new RoundToScaleHalfEven());
|
Express4Runner express4Runner = new Express4Runner(InitOptions.DEFAULT_OPTIONS);
|
||||||
|
express4Runner.addFunction("roundToScale", new RoundToScaleHalfEven());
|
||||||
String express_3 = "roundToScale(0.2434, 3)";
|
String express_3 = "roundToScale(0.2434, 3)";
|
||||||
Object result_3 = expressRunner.execute(express_3, null, null, false, false);
|
// Object result_3 = expressRunner.execute(express_3, null, null, false, false);
|
||||||
|
Object result_3 = express4Runner.execute(express_3, new HashMap<>(), QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
|
|
||||||
System.out.println("四舍0.2434 :" + result_3);
|
System.out.println("四舍0.2434 :" + result_3);
|
||||||
String express_4 = "roundToScale(0.2416, 3)";
|
String express_4 = "roundToScale(0.2416, 3)";
|
||||||
Object result_4 = expressRunner.execute(express_4, null, null, false, false);
|
// Object result_4 = expressRunner.execute(express_4, null, null, false, false);
|
||||||
|
Object result_4 = express4Runner.execute(express_4, new HashMap<>(), QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
System.out.println("六入0.2416 :" + result_4);
|
System.out.println("六入0.2416 :" + result_4);
|
||||||
String express_1 = "roundToScale(0.2445, 3)";
|
String express_1 = "roundToScale(0.2445, 3)";
|
||||||
Object result_1 = expressRunner.execute(express_1, null, null, false, false);
|
// Object result_1 = expressRunner.execute(express_1, null, null, false, false);
|
||||||
|
Object result_1 = express4Runner.execute(express_1, new HashMap<>(), QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
System.out.println("偶不变0.2445 :" + result_1);
|
System.out.println("偶不变0.2445 :" + result_1);
|
||||||
String express_2 = "roundToScale(0.2455, 3)";
|
String express_2 = "roundToScale(0.2455, 3)";
|
||||||
Object result_2 = expressRunner.execute(express_2, null, null, false, false);
|
// Object result_2 = expressRunner.execute(express_2, null, null, false, false);
|
||||||
System.out.println("奇变0.2445 :" + result_2);
|
Object result_2 = express4Runner.execute(express_2, new HashMap<>(), QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
|
System.out.println("奇变0.2455 :" + result_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void calculateAverageValueTest() throws Exception {
|
void calculateAverageValueTest() throws Exception {
|
||||||
ExpressRunner expressRunner = new ExpressRunner(true, false);
|
//兼容3 将安全策略设置为 “开放”
|
||||||
|
InitOptions initOptions = InitOptions.builder().securityStrategy(QLSecurityStrategy.open()).build();
|
||||||
|
Express4Runner expressRunner = new Express4Runner(initOptions);
|
||||||
|
// Express4Runner expressRunner = new Express4Runner(InitOptions.DEFAULT_OPTIONS);
|
||||||
/**
|
/**
|
||||||
String exp = ""
|
String exp = ""
|
||||||
+ "function abc(int a, int b) {"
|
+ "function abc(int a, int b) {"
|
||||||
@@ -77,15 +89,19 @@ public class QLExpressRunnerTest {
|
|||||||
|
|
||||||
int elementScale = 2;
|
int elementScale = 2;
|
||||||
|
|
||||||
DefaultContext<String, Object> context = new DefaultContext<>();
|
Map<String, Object> context = new HashMap<>();
|
||||||
context.put("values", valuesList);
|
context.put("values", valuesList);
|
||||||
context.put("scale", elementScale);
|
context.put("scale", elementScale);
|
||||||
Object result = expressRunner.execute(express, context, null, false, false);
|
// Object result = expressRunner.execute(express, context, null, false, false);
|
||||||
|
Object result = expressRunner.execute(express, context, QLOptions.DEFAULT_OPTIONS).getResult();
|
||||||
|
System.out.println(result);
|
||||||
|
result = expressRunner.execute(express, context, QLOptions.builder().precise(true).build()).getResult();
|
||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
|
|
||||||
|
|
||||||
String[] names = expressRunner.getOutVarNames(express);
|
// String[] names = expressRunner.getOutVarNames(express);
|
||||||
for(String s:names){
|
Set<String> outVarNames = expressRunner.getOutVarNames(express);
|
||||||
|
for(String s: outVarNames){
|
||||||
System.out.println("var : " + s);
|
System.out.println("var : " + s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user