方法变更修改

This commit is contained in:
2025-12-16 21:12:29 +08:00
parent 607dc05409
commit eb757e8271
26 changed files with 736 additions and 24 deletions

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -117,6 +117,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;

View File

@@ -5,6 +5,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;

View File

@@ -46,6 +46,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;

View File

@@ -49,6 +49,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;

View File

@@ -58,6 +58,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("检测数据")

View File

@@ -51,6 +51,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 = "检测数据不能为空")

View File

@@ -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;
} }

View File

@@ -34,6 +34,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;

View File

@@ -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")

View File

@@ -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);
} }

View File

@@ -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);

View File

@@ -420,7 +420,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
/** /**
* 根据分样查询分析任务 * 根据分样查询分析任务
* @param businessSubParentSampleIds 分样样id * @param businessSubParentSampleIds 分样样id列表
* @param configAssayMethodId 分析方法 * @param configAssayMethodId 分析方法
* @return * @return
*/ */

View File

@@ -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));
} }

View File

@@ -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)

View File

@@ -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())

View File

@@ -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);
/** /**
* 修改分析方法 * 修改分析方法

View File

@@ -9,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;
@@ -34,6 +33,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientP
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
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;
@@ -46,6 +47,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
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;
@@ -107,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;
@@ -179,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<>();
@@ -235,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) {
@@ -374,6 +848,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList); businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
} }
} }
**/
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)

View File

@@ -5,6 +5,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;

View File

@@ -5,6 +5,15 @@ 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 = "分析方法名称") @Schema(description = "分析方法名称")

View File

@@ -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;
@@ -63,5 +64,27 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX<ConfigAssayM
.selectAs(DictionaryProjectDO::getShowName, ConfigAssayMethodProjectExtendRespVO::getShowName) .selectAs(DictionaryProjectDO::getShowName, ConfigAssayMethodProjectExtendRespVO::getShowName)
.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()));
}
} }

View File

@@ -7,6 +7,7 @@ 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.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
@@ -61,6 +62,17 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId)); .eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
} }
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdsAndConfigAssayMethodIds(List<Long> configSubSampleIds, List<Long> configAssayMethodIds) {
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
.leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, ConfigSubSampleMethodDO::getConfigSubSampleId)
.selectAll(ConfigSubSampleMethodDO.class)
.selectAs(ConfigSubSampleDO::getConfigSubSampleParentId, ConfigSubSampleMethodExtendRespVO::getConfigSubSampleParentId)
.selectAs(ConfigSubSampleDO::getConfigBaseSampleId, ConfigSubSampleMethodExtendRespVO::getConfigBaseSampleId)
.selectAs(ConfigSubSampleDO::getBaseSampleId, ConfigSubSampleMethodExtendRespVO::getBaseSampleId)
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
.in(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodIds));
}
default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) { default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) {
return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>() return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)); .in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));

View File

@@ -19,8 +19,6 @@ 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.BusinessQCCoefficientDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
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.BusinessQCManagementProjectDataDO; 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;
@@ -31,6 +29,7 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper; 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;
@@ -223,13 +222,22 @@ public class XRFDataServiceImpl implements XRFDataService {
if(conYgElement.getDataType() != null && "decimal".equals(conYgElement.getDataType())) { if(conYgElement.getDataType() != null && "decimal".equals(conYgElement.getDataType())) {
conYgElementDataType = conYgElement.getDecimalPosition(); conYgElementDataType = conYgElement.getDecimalPosition();
} }
Long elementId = conYgElement.getDictionaryProjectId(); Long elementId = conYgElement.getDictionaryProjectId();
List<BusinessAssayProjectDataExtendRespVO> currBusElementValueList = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList()); List<BusinessAssayProjectDataExtendRespVO> currBusElementValueList = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).collect(Collectors.toList());
String symbol = "=";
String minimumLimitValue = "";
if (currBusElementValueList != null && currBusElementValueList.size() > 0) { if (currBusElementValueList != null && currBusElementValueList.size() > 0) {
for (BusinessAssayProjectDataExtendRespVO busElementValue : currBusElementValueList) { for (BusinessAssayProjectDataExtendRespVO busElementValue : currBusElementValueList) {
//化验数据小数精度四舍六入五单双 //化验数据小数精度四舍六入五单双
if("decimal".equals(busElementValue.getDataType())) { if("decimal".equals(busElementValue.getDataType())) {
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString());
if (elementValue.compareTo(new BigDecimal(busElementValue.getMinimumLimitValue())) < 0) {
symbol = "<";
minimumLimitValue = busElementValue.getMinimumLimitValue();
busElementValue.setValue(busElementValue.getMinimumLimitValue());
}
busElementValue.setSymbol(symbol);
} else { } else {
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
} }
@@ -245,6 +253,13 @@ public class XRFDataServiceImpl implements XRFDataService {
//化验数据小数精度四舍六入五单双 //化验数据小数精度四舍六入五单双
if("decimal".equals(busElementValue.getDataType())) { if("decimal".equals(busElementValue.getDataType())) {
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString()); 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 { } else {
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString()); busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
} }
@@ -258,13 +273,16 @@ public class XRFDataServiceImpl implements XRFDataService {
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);
} }
} }
//循环元素修改流程节点 //循环元素修改
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) {//已经添加过的,不再添加
@@ -285,6 +303,13 @@ public class XRFDataServiceImpl implements XRFDataService {
businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class)); 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);
} }

View File

@@ -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>

View File

@@ -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