From 09fd13af72796bbb14d09da6d0409e01c6d7e858 Mon Sep 17 00:00:00 2001 From: wxr Date: Wed, 15 Oct 2025 16:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E5=AE=9A=E7=BB=93=E6=9E=9C=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/qms/enums/QmsCommonConstant.java | 12 + .../admin/SampleAnalysisAuditController.java | 43 ++ .../vo/BatchSampleAnalysisColumnRespVO.java | 3 + ...usinessAssayProjectAndParameterRespVO.java | 4 +- .../BusinessAssayProjectDataExtendRespVO.java | 35 ++ .../vo/BusinessAssayProjectDataReqVO.java | 6 + .../vo/BusinessAssayTaskDataExtendRespVO.java | 8 + ...sinessSubSampleAssessmentExtendRespVO.java | 17 + .../controller/vo/ReportFieldValueData.java | 31 ++ .../vo/SampleAssayResultAssessmentRespVO.java | 37 ++ .../BusinessAssayParameterDataMapper.java | 1 + .../BusinessAssayProjectDataMapper.java | 32 ++ .../mapper/BusinessAssayReportDataMapper.java | 8 + .../mapper/BusinessAssayTaskDataMapper.java | 61 ++- .../BusinessHandoverRecordSubMapper.java | 16 + .../BusinessSubSampleAssessmentMapper.java | 17 + .../entrust/SampleEntrustReceiveDataCmp.java | 11 +- .../entrust/SampleEntrustSendDataCmp.java | 11 +- .../flow/SampleSubProcessUpdateCmp.java | 12 + .../service/SampleAnalysisAuditService.java | 10 + .../SampleAnalysisAuditServiceImpl.java | 379 ++++++++++++++++-- .../service/SampleAnalysisServiceImpl.java | 11 +- ...ssayMethodProjectCoefficientPageReqVO.java | 2 +- ...igAssayMethodProjectCoefficientRespVO.java | 2 +- ...ssayMethodProjectCoefficientSaveReqVO.java | 2 +- .../ConfigAssayMethodProjectExtendRespVO.java | 17 + .../vo/ConfigProjectExtendRespVO.java | 23 ++ .../vo/ConfigReportFieldPageReqVO.java | 27 +- .../controller/vo/ConfigReportFieldReqVO.java | 66 +++ .../vo/ConfigReportFieldRespVO.java | 50 +-- .../vo/ConfigReportFieldSaveReqVO.java | 60 ++- .../controller/vo/ConfigRulePageReqVO.java | 2 +- .../controller/vo/ConfigRuleRespVO.java | 2 +- .../controller/vo/ConfigRuleSaveReqVO.java | 10 +- .../vo/ConfigSampleReportExtendRespVO.java | 17 + .../vo/ConfigSampleReportReqVO.java | 39 ++ ...ConfigAssayMethodProjectCoefficientDO.java | 2 +- .../dal/dataobject/ConfigReportFieldDO.java | 37 +- .../config/dal/dataobject/ConfigRuleDO.java | 2 +- ...igAssayMethodProjectCoefficientMapper.java | 2 +- .../ConfigAssayMethodProjectMapper.java | 17 + .../dal/mapper/ConfigProjectMapper.java | 23 ++ .../dal/mapper/ConfigReportFieldMapper.java | 19 +- .../config/dal/mapper/ConfigRuleMapper.java | 2 +- .../dal/mapper/ConfigSampleReportMapper.java | 22 + 45 files changed, 1052 insertions(+), 158 deletions(-) create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java create mode 100644 zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java diff --git a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java index ac7ee9a..0d38618 100644 --- a/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java +++ b/zt-module-qms/zt-module-qms-api/src/main/java/com/zt/plat/module/qms/enums/QmsCommonConstant.java @@ -32,6 +32,9 @@ public interface QmsCommonConstant { /** 正常 **/ String NORMAL = "normal"; + /** 超差 **/ + String EXCEEDS_TOLERANCE = "exceeds_tolerance"; + /** 隔离 **/ String ISOLATION = "isolation"; @@ -74,6 +77,15 @@ public interface QmsCommonConstant { /** 已完成 **/ String COMPLETED = "completed"; + /** 固定字段 **/ + String FIELD_FIXED = "field_fixed"; + + /** 动态字段 **/ + String FIELD_DYNAMIC = "field_dynamic"; + + /** 计算字段 **/ + String FIELD_CALCULATED = "field_calculated"; + /** 委托登记 **/ String ENTRUST_REGISTRATION = "entrust_registration"; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java index f68c186..ddf6f08 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/admin/SampleAnalysisAuditController.java @@ -1,10 +1,12 @@ package com.zt.plat.module.qms.business.bus.controller.admin; import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import com.alibaba.fastjson2.JSONObject; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService; import io.swagger.v3.oas.annotations.tags.Tag; @@ -33,4 +35,45 @@ public class SampleAnalysisAuditController { sampleAnalysisAuditService.crossAuditByByTaskId(businessAssayTaskId, auditStatus); return success("成功"); } + + @GetMapping("/getSampleResultAssessmentList") + public CommonResult getSampleResultAssessmentList(Long configAssayMethodId) { + + JSONObject result = sampleAnalysisAuditService.getSampleResultAssessmentList(configAssayMethodId); + + return success(result); + } + + @GetMapping("/getResultAssessment") + public CommonResult getResultAssessment(String assayType, Long sampleId, Long configAssayMethodId) { + JSONObject result = null; + if ("平行".equals(assayType)) { + result = sampleAnalysisAuditService.getParallelResultAssessment(sampleId, configAssayMethodId); + } else if ("双杯".equals(assayType)) { + result = sampleAnalysisAuditService.getDoubleCupResultAssessment(sampleId, configAssayMethodId); + } + return success(result); + } + + //平行分析结果判定 + @GetMapping("/getParallelResultAssessment") + public CommonResult getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId) { + JSONObject result = sampleAnalysisAuditService.getParallelResultAssessment(businessSubSampleId, configAssayMethodId); + return success(result); + } + + //双杯分析结果判定 + @GetMapping("/getDoubleCupResultAssessment") + public CommonResult getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId) { + JSONObject result = sampleAnalysisAuditService.getDoubleCupResultAssessment(businessSubParentSampleId, configAssayMethodId); + return success(result); + } + + //判定数据上报 + @PostMapping("/assessmentDataReporting") + public CommonResult assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) { + sampleAnalysisAuditService.assessmentDataReporting(businessSubSampleId, configAssayMethodId); + return success("成功"); + } + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java index 7377cc2..ad21ad4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BatchSampleAnalysisColumnRespVO.java @@ -62,4 +62,7 @@ public class BatchSampleAnalysisColumnRespVO implements Serializable { @Schema(description = "单位") private String unit; + + @Schema(description = "填写方式") + private String fillingWay; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java index 344928f..21bf910 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectAndParameterRespVO.java @@ -57,5 +57,7 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable { /** 类型(1:元素,2:参数) **/ @Schema(description = "类型(project:元素,2:参数)") private String type; - + + @Schema(description = "填写方式") + private String fillingWay; } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java new file mode 100644 index 0000000..5a6e367 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataExtendRespVO.java @@ -0,0 +1,35 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessAssayProjectDataExtendRespVO extends BusinessAssayProjectDataRespVO { + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "归库编号") + private String sampleReturnCode; + + @Schema(description = "分析人员") + private String assayOperator; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; + + @Schema(description = "单位") + private String dictionaryProjectUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java index 3ffa519..d28f90f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayProjectDataReqVO.java @@ -13,6 +13,12 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class BusinessAssayProjectDataReqVO { + @Schema(description = "分样子样ID", example = "20464") + private Long businessSubSampleId; + + @Schema(description = "检测方法配置ID", example = "9130") + private Long configAssayMethodId; + @Schema(description = "检测任务ID", example = "16505") private Long businessAssayTaskDataId; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java index c1b3258..85fd2cc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessAssayTaskDataExtendRespVO.java @@ -1,10 +1,18 @@ package com.zt.plat.module.qms.business.bus.controller.vo; +import java.time.LocalDateTime; + import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @Data public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataRespVO { + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; /** 分析方法名称 **/ @Schema(description = "分析方法名称") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java new file mode 100644 index 0000000..aa9a947 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/BusinessSubSampleAssessmentExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class BusinessSubSampleAssessmentExtendRespVO extends BusinessSubSampleAssessmentRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java new file mode 100644 index 0000000..249bd17 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/ReportFieldValueData.java @@ -0,0 +1,31 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ReportFieldValueData implements Serializable { + + private static final long serialVersionUID = 4301653225442965919L; + + @Schema(description = "字段名称") + private String fieldName; + + @Schema(description = "值") + private String fieldValue; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "单位") + private String unit; + + @Schema(description = "符号") + private String mathSymbol; + +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java new file mode 100644 index 0000000..9173376 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/controller/vo/SampleAssayResultAssessmentRespVO.java @@ -0,0 +1,37 @@ +package com.zt.plat.module.qms.business.bus.controller.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +/** + * 样品分析结果判定 + */ +@Data +public class SampleAssayResultAssessmentRespVO implements Serializable { + + private static final long serialVersionUID = 5216179630941802338L; + + @Schema(description = "样品名称") + private String sampleName; + + @Schema(description = "样品编号") + private String sampleCode; + + @Schema(description = "分析编号") + private String sampleAssayCode; + + @Schema(description = "收样人") + private String sampleReceiver; + + @Schema(description = "收样时间") + private LocalDateTime sampleReceiveTime; + + @Schema(description = "分析人") + private String assayOperator; + + @Schema(description = "上报时间") + private LocalDateTime reportTime; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java index c66a4d0..d2f70ed 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayParameterDataMapper.java @@ -32,6 +32,7 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX selectByBusinessAssayTaskDataId(Long businessAssayTaskDataId) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .eq(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataId)); + } + + default List selectAnalysisBy(BusinessAssayProjectDataReqVO reqVO) { + return selectJoinList(BusinessAssayProjectDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(BusinessAssayTaskDataDO.class, BusinessAssayTaskDataDO::getId, BusinessAssayProjectDataDO::getBusinessAssayTaskDataId) + .leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) + .selectAll(BusinessAssayProjectDataDO.class) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectDataExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectDataExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessAssayProjectDataExtendRespVO::getShowName) + .selectAs(BusinessAssayTaskDataDO::getAssayOperator, BusinessAssayProjectDataExtendRespVO::getAssayOperator) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayProjectDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayProjectDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayProjectDataExtendRespVO::getSampleAssayCode) + .selectAs(BusinessSubSampleDO::getSampleReturnCode, BusinessAssayProjectDataExtendRespVO::getSampleReturnCode) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java index 15c0657..5dfd6ef 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayReportDataMapper.java @@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayReportDataPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -32,4 +35,9 @@ public interface BusinessAssayReportDataMapper extends BaseMapperX selectBytBusinessBaseSampleId(Long businessBaseSampleId) { + return selectList(new LambdaQueryWrapperX() + .eqIfPresent(BusinessAssayReportDataDO::getBusinessBaseSampleId, businessBaseSampleId)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java index f9fece6..f32cb04 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessAssayTaskDataMapper.java @@ -2,6 +2,9 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; import java.util.*; +import com.alibaba.druid.sql.ast.statement.SQLForeignKeyImpl.On; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.github.yulichang.wrapper.MPJLambdaWrapper; 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.MPJLambdaWrapperX; @@ -11,9 +14,13 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataGr import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataPageReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO; import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.collection.CollUtil; + import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -98,6 +105,47 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) { + return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId) + .leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId) +// .leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on +// .eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId).eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, 103)) + .selectAll(BusinessAssayTaskDataDO.class) + .selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName) + .selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName) + .selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode) + .selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode) +// .selectAs(BusinessSubSampleAnalysisGroupDO::getSampleReceiver, BusinessAssayTaskDataExtendRespVO::getSampleReceiver) +// .selectAs(BusinessSubSampleAnalysisGroupDO::getSampleReceiveTime, BusinessAssayTaskDataExtendRespVO::getSampleReceiveTime) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId()) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId()) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId()) + .eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId()) + .eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId()) + .eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType()) + .eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType()) + .eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject()) + .eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId()) + .likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName()) + .eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator()) + .betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()) + .eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked()) + .eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported()) + .eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter()) + .betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()) + .eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId()) + .eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey()) + .betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()) + .eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount()) + .eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount()) + .eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark()) + .orderByDesc(BusinessAssayTaskDataDO::getId)); + } + /** * 查询未指派的分析任务分组 * @param reqVO @@ -131,11 +179,14 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX selectIsReportedList(List excludeIds, Long businessSubSampleId, Long configAssayMethodId, Integer isReported) { - return selectList(new LambdaQueryWrapperX() - .notIn(BusinessAssayTaskDataDO::getId, excludeIds) - .eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) - .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) - .eq(BusinessAssayTaskDataDO::getIsReported, isReported)); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapperX(); + if (CollUtil.isNotEmpty(excludeIds)) { + queryWrapper.notIn(BusinessAssayTaskDataDO::getId, excludeIds); + } + queryWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId) + .eq(BusinessAssayTaskDataDO::getIsReported, isReported); + return selectList(queryWrapper); } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java index f48cc47..2f54e7e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessHandoverRecordSubMapper.java @@ -1,5 +1,6 @@ package com.zt.plat.module.qms.business.bus.dal.mapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessHandoverRecordSubExtendRespVO; @@ -8,6 +9,9 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecord import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -45,5 +49,17 @@ public interface BusinessHandoverRecordSubMapper extends BaseMapperX selectByBusinessSubSampleId(Long businessSubSampleId) { + return selectList(new LambdaQueryWrapper() + .eq(BusinessHandoverRecordSubDO::getBusinessSubSampleId, businessSubSampleId) + .orderByDesc(BusinessHandoverRecordSubDO::getCreateTime)); + } + + default List selectByBusinessSubSampleIds(List businessSubSampleIds) { + return selectList(new LambdaQueryWrapper() + .in(BusinessHandoverRecordSubDO::getBusinessSubSampleId, businessSubSampleIds) + .orderByDesc(BusinessHandoverRecordSubDO::getCreateTime)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java index d6bc223..c41bd16 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/dal/mapper/BusinessSubSampleAssessmentMapper.java @@ -2,10 +2,15 @@ package com.zt.plat.module.qms.business.bus.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.query.MPJLambdaWrapperX; import com.zt.plat.module.qms.business.bus.controller.vo.*; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentPageReqVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; /** @@ -38,5 +43,17 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) { + return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId) + .selectAll(BusinessSubSampleAssessmentDO.class) + .selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName) + .eq(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, businessSubSampleId) + .eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId) + ); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java index 3f8a088..3842dbd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustReceiveDataCmp.java @@ -2,15 +2,22 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; - +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.bus.service.SampleFlowService; + +import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleEntrustReceiveDataCmp", name = "中心接收样品委托的样品数据") public class SampleEntrustReceiveDataCmp extends NodeComponent { + + @Resource + private SampleFlowService sampleFlowService; @Override public void process() throws Exception { - + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowService.sampleFlow(sampleFlowParam); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java index df01ef9..b7add8e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/entrust/SampleEntrustSendDataCmp.java @@ -2,15 +2,22 @@ package com.zt.plat.module.qms.business.bus.liteflow.sample.entrust; import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; - +import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowParam; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext; +import com.zt.plat.module.qms.business.bus.service.SampleFlowService; + +import jakarta.annotation.Resource; @LiteflowComponent(id = "sampleEntrustSendDataCmp", name = "中心送样品委托的样品数据到分析室") public class SampleEntrustSendDataCmp extends NodeComponent { + + @Resource + private SampleFlowService sampleFlowService; @Override public void process() throws Exception { - + SampleFlowParam sampleFlowParam = new SampleFlowParam(); + sampleFlowService.sampleFlow(sampleFlowParam); } @Override diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java index 4c4c455..5b56d3d 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/liteflow/sample/flow/SampleSubProcessUpdateCmp.java @@ -10,9 +10,12 @@ import com.yomahub.liteflow.annotation.LiteflowComponent; import com.yomahub.liteflow.core.NodeComponent; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessHandoverRecordSubMapper; import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleFlowContext; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigRuleMapper; import com.zt.plat.module.qms.business.config.service.ConfigSampleFlowService; //import com.zt.plat.module.qms.business.config.service.ConfigSubSampleService; import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition; @@ -28,8 +31,14 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { @Resource private ExpressRunner expressRunner; + @Resource + private ConfigRuleMapper configRuleMapper; + @Resource private ConfigSampleFlowService configSampleFlowService; + + @Resource + private BusinessHandoverRecordSubMapper businessHandoverRecordSubMapper; @Override public void process() throws Exception { @@ -38,8 +47,11 @@ public class SampleSubProcessUpdateCmp extends NodeComponent { // LoginUser loginUser = sampleFlowContext.getLoginUser(); // String loginRealname = sampleFlowContext.getLoginRealname(); LocalDateTime currentDateTime = sampleFlowContext.getCurrentDateTime(); + List sampleIdList = sampleFlowContext.getSampleIdList(); List busSubCsampleList = sampleFlowContext.getBusinessSubSampleList(); List businessAssayTaskDataList = sampleFlowContext.getBusinessAssayTaskDataList(); + //查询历史交接记录 + List businessHandoverRecordSubDOList = businessHandoverRecordSubMapper.selectByBusinessSubSampleIds(sampleIdList); for (BusinessSubSampleDO businessSubSample : busSubCsampleList) { ConfigSampleFlowDO configSampleFlow = configSampleFlowService.getConfigSampleFlow(businessSubSample.getConfigSampleFlowId()); String configSampleFlowContent = configSampleFlow.getContent(); diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java index 691c638..b6b2880 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditService.java @@ -1,5 +1,7 @@ package com.zt.plat.module.qms.business.bus.service; +import com.alibaba.fastjson2.JSONObject; + /** * SampleAnalysisAuditService *

@@ -16,4 +18,12 @@ public interface SampleAnalysisAuditService { void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus); + JSONObject getSampleResultAssessmentList(Long configAssayMethodId); + + JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId); + + JSONObject getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId); + + void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId); + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java index 971c0cc..49dc028 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisAuditServiceImpl.java @@ -3,27 +3,55 @@ package com.zt.plat.module.qms.business.bus.service; import java.math.BigDecimal; import java.math.RoundingMode; import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.alibaba.fastjson2.JSON; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.ql.util.express.ExpressRunner; import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; 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.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.BusinessAssayTaskDataDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO; +import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper; import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper; +import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessTeamAssessmentMapper; +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.ConfigReportFieldDO; import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigProjectMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportFieldMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportTypeMapper; +import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper; import com.zt.plat.module.qms.core.qlexpress.cmp.AllowanceCalculatorComponent; import com.zt.plat.module.qms.enums.QmsCommonConstant; + +import cn.hutool.core.bean.BeanUtil; import jakarta.annotation.Resource; /** @@ -61,9 +89,163 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic @Resource private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper; + + @Resource + private BusinessTeamAssessmentMapper businessTeamAssessmentMapper; + + @Resource + private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper; + + @Resource + private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper; + @Override + public JSONObject getSampleResultAssessmentList(Long configAssayMethodId) { + List configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + List> columnList = new ArrayList<>(); +// columnList.add(new HashMap() {{ +// put("title", "样品名称"); +// put("field", "sampleName"); +// put("dataType", "string"); +// put("decimalPosition", null); +// put("isEdit", false); +// }}); +// columnList.add(new HashMap() {{ +// put("title", "样品编号"); +// put("field", "sampleAssayCode"); +// put("dataType", "string"); +// put("decimalPosition", null); +// put("isEdit", false); +// }}); +// columnList.add(new HashMap() {{ +// put("title", "收样时间"); +// put("field", "sampleReceiveTime"); +// put("dataType", "string"); +// put("decimalPosition", null); +// put("isEdit", false); +// }}); +// columnList.add(new HashMap() {{ +// put("title", "分析人"); +// put("field", "assayOperator"); +// put("dataType", "string"); +// put("decimalPosition", null); +// put("isEdit", false); +// }}); +// columnList.add(new HashMap() {{ +// put("title", "上报时间"); +// put("field", "reportTime"); +// put("dataType", "string"); +// put("decimalPosition", null); +// put("isEdit", false); +// }}); + for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectDOList) { + columnList.add(new HashMap() {{ + put("title", configAssayMethodProject.getShowName() + "(" + configAssayMethodProject.getDictionaryProjectUnit() + ")"); + put("field", configAssayMethodProject.getSimpleName()); + put("dataType", configAssayMethodProject.getDataType()); + put("decimalPosition", configAssayMethodProject.getDecimalPosition()); + put("isEdit", true); + }}); + } + + List> dataList = new ArrayList<>(); + BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); + search.setConfigAssayMethodId(configAssayMethodId); + List resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search); + for (BusinessAssayTaskDataExtendRespVO businessAssayTaskDataExtendRespVO : resultAssessmentList) { + Map businessAssayTaskDataMap = BeanUtil.beanToMap(businessAssayTaskDataExtendRespVO); + Map businessAssayTaskDataAssessmentMap = BeanUtil.copyProperties(businessAssayTaskDataMap, Map.class); + businessAssayTaskDataAssessmentMap.put("assayOperator", "判定结果"); + businessAssayTaskDataAssessmentMap.put("reportTime", null); + + + boolean isExis = dataList.stream().anyMatch(f -> + Objects.equals(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), f.get("businessSubSampleId")) && + Objects.equals(businessAssayTaskDataExtendRespVO.getConfigAssayMethodId(), f.get("configAssayMethodId")) && + "判定结果".equals(f.get("assayOperator")) + ); + if (!isExis) { + if ("平行".equals(businessAssayTaskDataExtendRespVO.getAssayType())) { + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessAssayTaskDataExtendRespVO.getBusinessSubSampleId(), configAssayMethodId); + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + businessAssayTaskDataAssessmentMap.put("id", businessSubSampleAssessment.getId()); + businessAssayTaskDataAssessmentMap.put(businessSubSampleAssessment.getSimpleName(), businessSubSampleAssessment.getAssessmentValue()); + businessAssayTaskDataAssessmentMap.put("assessmentStatus", businessSubSampleAssessment.getAssessmentValue()); + } + } else if ("双杯".equals(businessAssayTaskDataExtendRespVO.getAssayType())) { + //businessTeamAssessmentMapper.selectBy + } + dataList.add(businessAssayTaskDataAssessmentMap); + } + + + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataExtendRespVO.getId()); + for (BusinessAssayProjectDataExtendRespVO businessAssayProjectData : businessAssayProjectDataList) { + businessAssayTaskDataMap.put(businessAssayProjectData.getSimpleName(), businessAssayProjectData.getValue()); + } + dataList.add(businessAssayTaskDataMap); + + } + + + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + return json; + } + + + @Override + public JSONObject getParallelResultAssessment(Long businessSubSampleId, Long configAssayMethodId) { + List> columnList = new ArrayList<>(); + List> dataList = new ArrayList<>(); + + //查询判定值 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + Map businessSubSampleAssessmentMap = BeanUtil.beanToMap(businessSubSampleAssessment); + + + + dataList.add(businessSubSampleAssessmentMap); + } + + //查询子样平行分析结果 + BusinessAssayProjectDataReqVO search = new BusinessAssayProjectDataReqVO(); + search.setBusinessSubSampleId(businessSubSampleId); + search.setConfigAssayMethodId(configAssayMethodId); + List businessAssayProjectDataList = businessAssayProjectDataMapper.selectAnalysisBy(search); + +// BusinessAssayTaskDataReqVO search = new BusinessAssayTaskDataReqVO(); +// search.setBusinessSubSampleId(businessSubSampleId); +// search.setConfigAssayMethodId(configAssayMethodId); +// List resultAssessmentList = businessAssayTaskDataMapper.selectResultAssessmentList(search); + + JSONObject json = new JSONObject(); + json.put("columns", columnList); + json.put("datas", dataList); + json.put("subDatas", businessAssayProjectDataList); + return json; + } + + @Override + public JSONObject getDoubleCupResultAssessment(Long businessSubParentSampleId, Long configAssayMethodId) { + // TODO Auto-generated method stub + return null; + } + @Override public void crossAuditByByTaskId(Long businessAssayTaskId, String auditStatus) { + + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + + //班组长双杯判定记录 + List businessTeamAssessmentDOList = new ArrayList<>(); + + //平行样判定记录 + List businessSubSampleAssessmentDOList = new ArrayList<>(); BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); if (QmsCommonConstant.APPROVE.equals(auditStatus)) { @@ -79,7 +261,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic Map> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getBusinessSubSampleId)); for (Map.Entry> businessAssayTaskDataDOMapEntry : businessAssayTaskDataDOMap.entrySet()) { - //Long key = businessAssayTaskDataDOMapEntry.getKey(); + Long businessSubSampleId = businessAssayTaskDataDOMapEntry.getKey(); List businessAssayTaskDataList = businessAssayTaskDataDOMapEntry.getValue(); List businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList()); BusinessAssayTaskDataDO businessAssayTaskDataDO = businessAssayTaskDataList.get(0); @@ -100,12 +282,23 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic //查询分析项目 List businessAssayProjectDataDOList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList)); Map> businessAssayProjectDataDOMap = businessAssayProjectDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayProjectDataDO::getDictionaryProjectId)); - for (Map.Entry> entry1 : businessAssayProjectDataDOMap.entrySet()) { - Long dictionaryProjectId = entry1.getKey(); - List val1 = entry1.getValue(); + for (Map.Entry> businessAssayProjectDataDOEntry : businessAssayProjectDataDOMap.entrySet()) { + Long dictionaryProjectId = businessAssayProjectDataDOEntry.getKey(); + List val1 = businessAssayProjectDataDOEntry.getValue(); BusinessAssayProjectDataDO businessAssayProjectDataDO = val1.get(0); List configAssayMethodProjectAssessmentDOList = configAssayMethodProjectAssessmentMapper.selectList(new LambdaQueryWrapperX().eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodId, businessAssayTaskDataDO.getConfigAssayMethodId()).eq(ConfigAssayMethodProjectAssessmentDO::getConfigAssayMethodProjectId, businessAssayProjectDataDO.getConfigAssayMethodProjectId())); + //判定结果数据 + BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO(); + businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleId); + businessSubSampleAssessmentDO.setConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId()); + businessSubSampleAssessmentDO.setConfigAssayMethodProjectId(businessAssayProjectDataDO.getConfigAssayMethodProjectId()); + businessSubSampleAssessmentDO.setDictionaryProjectId(dictionaryProjectId); + businessSubSampleAssessmentDO.setDataType(businessAssayProjectDataDO.getDataType()); + businessSubSampleAssessmentDO.setDecimalPosition(businessAssayProjectDataDO.getDecimalPosition()); + businessSubSampleAssessmentDO.setAssayType(businessAssayTaskDataDO.getAssayType()); + businessSubSampleAssessmentDO.setTaskType(businessAssayTaskDataDO.getTaskType()); + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL); // 排序并处理 null List sortedValues = val1.stream() @@ -119,7 +312,10 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic // 获取小数精度 int elementScale = businessAssayProjectDataDO.getDecimalPosition(); // 计算代表值(均值或差值) - BigDecimal representativeValue = calculateRepresentativeValue(sortedValues); + BigDecimal representativeValue = calculateRepresentativeValue(sortedValues, elementScale); + + //设置判定值 + businessSubSampleAssessmentDO.setAssessmentValue(representativeValue.toPlainString()); // 查找匹配的允差规则 ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue); @@ -139,30 +335,12 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic for (int i = 0; i < sortedValues.size() - 1; i++) { BigDecimal diff = sortedValues.get(i + 1).subtract(sortedValues.get(i)).abs(); if (diff.compareTo(allowValue) > 0) { - + businessSubSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.EXCEEDS_TOLERANCE); } } - - + businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO); } - - - - - - - - - - - - - - - - - @@ -179,18 +357,13 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } -// for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { -// if ("平行".equals(businessAssayTaskDataDO.getAssayType())) { -// //判定检查项目是否都已上报 -// -// -// } -// -// -// -// } - + for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) { + businessAssayTaskDataDO.setIsReported(1); + businessAssayTaskDataDO.setReportTime(LocalDateTime.now()); + businessAssayTaskDataDO.setReporter(nickName); + } + businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList); @@ -208,6 +381,16 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); } businessAssayTaskMapper.updateById(businessAssayTaskDO); + + //插入平行判定记录 + if (businessSubSampleAssessmentDOList.size() > 0) { + businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList); + } + + //插入双杯判定记录 + if (businessTeamAssessmentDOList.size() > 0) { + businessTeamAssessmentMapper.insertBatch(businessTeamAssessmentDOList); + } } // 查找匹配的允差区间 @@ -242,14 +425,130 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic } // 计算代表值:1个取本身,2个取均值,>2取平均 - private BigDecimal calculateRepresentativeValue(List values) { + private BigDecimal calculateRepresentativeValue(List values, int elementScale) { int size = values.size(); if (size == 0) return BigDecimal.ZERO; - if (size == 1) return values.get(0); + if (size == 1) return values.get(0).setScale(elementScale, RoundingMode.HALF_EVEN); if (size == 2) { - return values.get(0).add(values.get(1)).divide(BigDecimal.valueOf(2), 6, RoundingMode.HALF_EVEN); + return values.get(0).add(values.get(1)).divide(BigDecimal.valueOf(2), elementScale, RoundingMode.HALF_EVEN); } BigDecimal sum = values.stream().reduce(BigDecimal.ZERO, BigDecimal::add); - return sum.divide(BigDecimal.valueOf(size), 6, RoundingMode.HALF_EVEN); + return sum.divide(BigDecimal.valueOf(size), elementScale, RoundingMode.HALF_EVEN); } + + @Resource + private ConfigSampleReportMapper configSampleReportMapper; + + @Resource + private ConfigReportFieldMapper configReportFieldMapper; + + @Resource + private ConfigReportTypeMapper configReportTypeMapper; + + @Resource + private ConfigProjectMapper configProjectMapper; + + @Resource + private BusinessAssayReportDataMapper businessAssayReportDataMapper; + + @Resource + private BusinessBaseSampleMapper businessBaseSampleMapper; + + @Override + @Transactional(rollbackFor = Exception.class) + public void assessmentDataReporting(Long businessSubSampleId, Long configAssayMethodId) { + //当前登录用户昵称 + String nickName = SecurityFrameworkUtils.getLoginUserNickname(); + List unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.NO); + if (unReportedList.size() > 0) { + throw new ServiceException(500, "存在未上报的数据"); + } + List saveBusinessAssayReportDataDOList = new ArrayList<>(); + List updateBusinessAssayReportDataDOList = new ArrayList<>(); + //分析任务已全部上报 + List reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.YES); + //平行样判定结果 + List businessSubSampleAssessmentList = businessSubSampleAssessmentMapper.selectByBusinessSubSampleIdAndConfigAssayMethodId(businessSubSampleId, configAssayMethodId); + + List businessSubSampleAssessmentIdList = businessSubSampleAssessmentList.stream().map(m -> m.getId()).collect(Collectors.toList()); + + BusinessAssayTaskDataDO businessAssayTaskDataDO = reportedList.get(0); + + //查询主样 + BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId()); + + //查询报表 + List businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + + ConfigSampleReportReqVO configSampleReportSearch = new ConfigSampleReportReqVO(); + configSampleReportSearch.setConfigBaseSampleId(businessBaseSampleDO.getConfigBaseSampleId()); + List configSampleReportList = configSampleReportMapper.selectList(configSampleReportSearch); + + List configReportTypeIdList = configSampleReportList.stream().map(m -> m.getConfigReportTypeId()).collect(Collectors.toList()); + + //查询动态和计算的报表字段 + List configReportFieldList = configReportFieldMapper.selectByConfigReportTypeIds(configReportTypeIdList, Arrays.asList(QmsCommonConstant.FIELD_DYNAMIC, QmsCommonConstant.FIELD_CALCULATED)); + //动态报表字段 + List configReportFieldDynamicList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_DYNAMIC.equals(f.getFieldType())).collect(Collectors.toList()); + //根据检测方法查询字段配置 + List configProjectList = configProjectMapper.selectByConfigAssayMethodId(configAssayMethodId); + + for (ConfigSampleReportExtendRespVO configSampleReport : configSampleReportList) { + BusinessAssayReportDataDO businessAssayReportDataDO = businessAssayReportDataDOList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getConfigSampleReportId().equals(configSampleReport.getId())).findFirst().orElse(null); + if (businessAssayReportDataDO == null) { + businessAssayReportDataDO = new BusinessAssayReportDataDO(); + businessAssayReportDataDO.setBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId()); + businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId()); + businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId()); + businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode()); + + saveBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } else { + updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO); + } + JSONObject assayDataJson = new JSONObject(); + String assayData = businessAssayReportDataDO.getAssayData(); + if (StringUtils.isNotBlank(assayData)) { + assayDataJson = JSON.parseObject(assayData); + } + //循环判定值 + for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) { + Long configAssayMethodProjectId = businessSubSampleAssessment.getConfigAssayMethodProjectId(); + List configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList()); + for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) { + //查询动态报表字段 + ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null); + + if (configReportField == null) { + continue; + } + + ReportFieldValueData reportFieldValueData = new ReportFieldValueData(); + reportFieldValueData.setFieldName(configReportField.getFieldName()); + reportFieldValueData.setFieldValue(businessSubSampleAssessment.getAssessmentValue()); + reportFieldValueData.setDataType(configReportField.getDataType()); + reportFieldValueData.setMathSymbol("="); + reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit()); + assayDataJson.put(configReportField.getField(), reportFieldValueData); + } + } + businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString()); + } + + + if (saveBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList); + } + if (updateBusinessAssayReportDataDOList.size() > 0) { + businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList); + } + businessSubSampleAssessmentMapper.update(new LambdaUpdateWrapper() + .set(BusinessSubSampleAssessmentDO::getIsReported, QmsCommonConstant.YES) + .set(BusinessSubSampleAssessmentDO::getReporter, nickName) + .set(BusinessSubSampleAssessmentDO::getReportTime, LocalDateTime.now()) + .in(BusinessSubSampleAssessmentDO::getId, businessSubSampleAssessmentIdList)); + } + + + } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java index 69457de..cc2088c 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/bus/service/SampleAnalysisServiceImpl.java @@ -41,6 +41,8 @@ import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectRangeMapper; import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO; import com.zt.plat.module.qms.common.data.service.DataCollectionService; +import com.zt.plat.module.qms.enums.QmsCommonConstant; + import jakarta.annotation.Resource; /** @@ -104,8 +106,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { //处理列 List cloumns = new ArrayList<>(); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null)); - cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null)); + cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null)); //cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null)); @@ -121,7 +123,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { String fieldIndex = "e" + ep.getDicId(); String title = ep.getShowName() + (StringUtils.isBlank(ep.getUnit()) ? "" : "(" + ep.getUnit() + ")"); boolean isEdit = StringUtils.isBlank(ep.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), ep.getFillingWay())); if (StringUtils.isNotEmpty(ep.getFormula())) { BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO(); @@ -131,7 +133,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { fieldIndex = "p" + p.getDicId(); title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")"); isEdit = StringUtils.isBlank(p.getFormula()); - cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit())); + cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), p.getFillingWay())); } } } @@ -305,6 +307,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService { BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId); businessAssayTaskDO.setReportOperator(loginUserNickname); businessAssayTaskDO.setReportTime(LocalDateTime.now()); + businessAssayTaskDO.setFlowStatus(QmsCommonConstant.NOT_START); businessAssayTaskMapper.updateById(businessAssayTaskDO); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java index 4a904f5..716b853 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientPageReqVO.java @@ -39,7 +39,7 @@ public class ConfigAssayMethodProjectCoefficientPageReqVO extends PageParam { private BigDecimal coefficient; @Schema(description = "所属部门") - private String systemDepartmentCustomsDeclaration; + private String systemDepartmentCode; @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java index de91112..83cd2c9 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientRespVO.java @@ -51,7 +51,7 @@ public class ConfigAssayMethodProjectCoefficientRespVO { @Schema(description = "所属部门") @ExcelProperty("所属部门") - private String systemDepartmentCustomsDeclaration; + private String systemDepartmentCode; @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("创建时间") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java index 359d1e3..d588ce5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectCoefficientSaveReqVO.java @@ -42,7 +42,7 @@ public class ConfigAssayMethodProjectCoefficientSaveReqVO { private BigDecimal coefficient; @Schema(description = "所属部门") - private String systemDepartmentCustomsDeclaration; + private String systemDepartmentCode; @Schema(description = "备注") private String remark; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java new file mode 100644 index 0000000..73e938d --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigAssayMethodProjectExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigAssayMethodProjectExtendRespVO extends ConfigAssayMethodProjectRespVO { + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String simpleName; + + @Schema(description = "显示名称") + private String showName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java new file mode 100644 index 0000000..256390a --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigProjectExtendRespVO.java @@ -0,0 +1,23 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigProjectExtendRespVO extends ConfigProjectRespVO { + + @Schema(description = "检测方法分析项目配置ID") + private Long configAssayMethodProjectId; + + @Schema(description = "检测项目key") + private String dictionaryProjectKey; + + @Schema(description = "检测项目缩写") + private String dictionaryProjectSimpleName; + + @Schema(description = "检测项目显示名称") + private String dictionaryProjectShowName; + + @Schema(description = "检测项目单位") + private String dictionaryProjectUnit; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java index 15f6266..3cc7fdc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldPageReqVO.java @@ -13,30 +13,33 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH @Data public class ConfigReportFieldPageReqVO extends PageParam { - @Schema(description = "报表类型ID", example = "24954") + @Schema(description = "报表类型ID", example = "27695") private Long configReportTypeId; @Schema(description = "绑定字段") private String field; - @Schema(description = "标题名称", example = "赵六") + @Schema(description = "标题名称", example = "王五") private String fieldName; - @Schema(description = "排序号") - private Integer no; - - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2") - private Integer dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; @Schema(description = "列宽") private Integer fieldWidth; + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + @Schema(description = "是否分组") private Integer isGroup; + @Schema(description = "表头分组") + private String titleGroup; + @Schema(description = "是否可修改") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Integer[] isUpdate; @@ -44,8 +47,8 @@ public class ConfigReportFieldPageReqVO extends PageParam { @Schema(description = "计算公式") private String formula; - @Schema(description = "表头分组") - private String titleGroup; + @Schema(description = "排序号") + private Integer no; @Schema(description = "所属部门") private String systemDepartmentCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java new file mode 100644 index 0000000..8177542 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldReqVO.java @@ -0,0 +1,66 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import com.zt.plat.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 报表字段配置分页 Request VO") +@Data +public class ConfigReportFieldReqVO { + + @Schema(description = "报表类型ID", example = "27695") + private Long configReportTypeId; + + @Schema(description = "绑定字段") + private String field; + + @Schema(description = "标题名称", example = "王五") + private String fieldName; + + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; + + @Schema(description = "列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否分组") + private Integer isGroup; + + @Schema(description = "表头分组") + private String titleGroup; + + @Schema(description = "是否可修改") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private Integer[] isUpdate; + + @Schema(description = "计算公式") + private String formula; + + @Schema(description = "排序号") + private Integer no; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注,1-是,0-否") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java index 3175d06..ff10a94 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldRespVO.java @@ -12,11 +12,11 @@ import com.alibaba.excel.annotation.*; @ExcelIgnoreUnannotated public class ConfigReportFieldRespVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20910") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4375") @ExcelProperty("ID") private Long id; - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24954") + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27695") @ExcelProperty("报表类型ID") private Long configReportTypeId; @@ -24,43 +24,47 @@ public class ConfigReportFieldRespVO { @ExcelProperty("绑定字段") private String field; - @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @ExcelProperty("标题名称") private String fieldName; - @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("排序号") - private Integer no; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + @ExcelProperty("字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated") + private String fieldType; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") + @Schema(description = "列宽") + @ExcelProperty("列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间") - private Integer dataType; + private String dataType; @Schema(description = "小数位") @ExcelProperty("小数位") private Integer decimalPosition; - @Schema(description = "列宽", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("列宽") - private Integer fieldWidth; - - @Schema(description = "是否分组", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否分组") @ExcelProperty("是否分组") private Integer isGroup; - @Schema(description = "是否可修改", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("是否可修改") - private Integer isUpdate; - - @Schema(description = "计算公式", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("计算公式") - private String formula; - - @Schema(description = "表头分组", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "表头分组") @ExcelProperty("表头分组") private String titleGroup; - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "是否可修改") + @ExcelProperty("是否可修改") + private Integer isUpdate; + + @Schema(description = "计算公式") + @ExcelProperty("计算公式") + private String formula; + + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("排序号") + private Integer no; + + @Schema(description = "所属部门") @ExcelProperty("所属部门") private String systemDepartmentCode; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java index 556cef9..b8faf47 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigReportFieldSaveReqVO.java @@ -9,10 +9,10 @@ import jakarta.validation.constraints.*; @Data public class ConfigReportFieldSaveReqVO { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20910") + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4375") private Long id; - @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24954") + @Schema(description = "报表类型ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27695") @NotNull(message = "报表类型ID不能为空") private Long configReportTypeId; @@ -20,42 +20,40 @@ public class ConfigReportFieldSaveReqVO { @NotEmpty(message = "绑定字段不能为空") private String field; - @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六") + @Schema(description = "标题名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") @NotEmpty(message = "标题名称不能为空") private String fieldName; + @Schema(description = "字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated", example = "1") + private String fieldType; + + @Schema(description = "列宽") + private Integer fieldWidth; + + @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") + @NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") + private String dataType; + + @Schema(description = "小数位") + private Integer decimalPosition; + + @Schema(description = "是否分组") + private Integer isGroup; + + @Schema(description = "表头分组") + private String titleGroup; + + @Schema(description = "是否可修改") + private Integer isUpdate; + + @Schema(description = "计算公式") + private String formula; + @Schema(description = "排序号", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "排序号不能为空") private Integer no; - @Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2") - @NotNull(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空") - private Integer dataType; - - @Schema(description = "小数位") - private Integer decimalPosition; - - @Schema(description = "列宽", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "列宽不能为空") - private Integer fieldWidth; - - @Schema(description = "是否分组", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否分组不能为空") - private Integer isGroup; - - @Schema(description = "是否可修改", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "是否可修改不能为空") - private Integer isUpdate; - - @Schema(description = "计算公式", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "计算公式不能为空") - private String formula; - - @Schema(description = "表头分组", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "表头分组不能为空") - private String titleGroup; - - @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "所属部门") private String systemDepartmentCode; @Schema(description = "备注,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java index 9785f21..ed81719 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRulePageReqVO.java @@ -26,7 +26,7 @@ public class ConfigRulePageReqVO extends PageParam { private String type; @Schema(description = "表达式") - private String eXPRESSION; + private String expression; @Schema(description = "版本") private Integer version; diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java index 369e372..ce6c2dd 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleRespVO.java @@ -34,7 +34,7 @@ public class ConfigRuleRespVO { @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("表达式") - private String eXPRESSION; + private String expression; @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) @ExcelProperty("版本") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java index 16a0ca7..44a8871 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigRuleSaveReqVO.java @@ -12,14 +12,15 @@ public class ConfigRuleSaveReqVO { @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21005") private Long id; - @Schema(description = "编码") + @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "编码不能为空") private String code; @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") @NotEmpty(message = "名称不能为空") private String name; - @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "描述") @NotEmpty(message = "描述不能为空") private String description; @@ -28,10 +29,9 @@ public class ConfigRuleSaveReqVO { @Schema(description = "表达式", requiredMode = Schema.RequiredMode.REQUIRED) @NotEmpty(message = "表达式不能为空") - private String eXPRESSION; + private String expression; - @Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "版本不能为空") + @Schema(description = "版本") private Integer version; @Schema(description = "是否最新版本,1-是,0-否") diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java new file mode 100644 index 0000000..31ea903 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportExtendRespVO.java @@ -0,0 +1,17 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Data +public class ConfigSampleReportExtendRespVO extends ConfigSampleReportRespVO { + + @Schema(description = "报表类型ID", example = "15805") + private Long configReportTypeId; + + @Schema(description = "报表类型Key", example = "15805") + private String configReportTypeKey; + + @Schema(description = "报表类型Name", example = "15805") + private String configReportTypeName; +} diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java new file mode 100644 index 0000000..d773fb9 --- /dev/null +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/controller/vo/ConfigSampleReportReqVO.java @@ -0,0 +1,39 @@ +package com.zt.plat.module.qms.business.config.controller.vo; + +import lombok.*; +import io.swagger.v3.oas.annotations.media.Schema; +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 ConfigSampleReportReqVO { + + @Schema(description = "报表类型", example = "30219") + private Long configReportTypeId; + + @Schema(description = "主样配置ID", example = "29156") + private Long configBaseSampleId; + + @Schema(description = "样品名称", example = "张三") + private String sampleName; + + @Schema(description = "数据来源") + private String dataSource; + + @Schema(description = "所属部门") + private String systemDepartmentCode; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "备注") + private String remark; + + @Schema(description = "版本") + private Integer version; + +} \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java index 284957e..8902230 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigAssayMethodProjectCoefficientDO.java @@ -76,7 +76,7 @@ public class ConfigAssayMethodProjectCoefficientDO extends BusinessBaseDO { * 所属部门 */ @TableField("SYS_DEPT_CD") - private String systemDepartmentCustomsDeclaration; + private String systemDepartmentCode; /** * 备注 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java index 798e4cd..c00706f 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigReportFieldDO.java @@ -47,31 +47,36 @@ public class ConfigReportFieldDO extends BusinessBaseDO { @TableField("FLD_NAME") private String fieldName; /** - * 排序号 + * 字段类型,固定字段-field_fixed、动态字段-field_dynamic、计算字段-field_calculated */ - @TableField("NO") - private Integer no; - /** - * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 - */ - @TableField("DAT_TP") - private Integer dataType; - /** - * 小数位 - */ - @TableField("DEC_POS") - private Integer decimalPosition; + @TableField("FLD_TP") + private String fieldType; /** * 列宽 */ @TableField("FLD_WDTH") private Integer fieldWidth; /** + * 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间 + */ + @TableField("DAT_TP") + private String dataType; + /** + * 小数位 + */ + @TableField("DEC_POS") + private Integer decimalPosition; + /** * 是否分组 */ @TableField("IS_GRP") private Integer isGroup; /** + * 表头分组 + */ + @TableField("TTL_GRP") + private String titleGroup; + /** * 是否可修改 */ @TableField("IS_UPD") @@ -82,10 +87,10 @@ public class ConfigReportFieldDO extends BusinessBaseDO { @TableField("FMU") private String formula; /** - * 表头分组 + * 排序号 */ - @TableField("TTL_GRP") - private String titleGroup; + @TableField("NO") + private Integer no; /** * 所属部门 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java index f975373..3ca9bf5 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/dataobject/ConfigRuleDO.java @@ -55,7 +55,7 @@ public class ConfigRuleDO extends BusinessBaseDO { * 表达式 */ @TableField("EPSSN") - private String eXPRESSION; + private String expression; /** * 版本 */ diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java index de081f1..bc2eda1 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigAssayMethodProjectCoefficientMapper.java @@ -27,7 +27,7 @@ public interface ConfigAssayMethodProjectCoefficientMapper extends BaseMapperX selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, ConfigAssayMethodProjectDO::getDictionaryProjectId) + .selectAll(ConfigAssayMethodProjectDO.class) + .selectAs(DictionaryProjectDO::getKey, ConfigAssayMethodProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, ConfigAssayMethodProjectExtendRespVO::getSimpleName) + .selectAs(DictionaryProjectDO::getShowName, ConfigAssayMethodProjectExtendRespVO::getShowName) + .eq(ConfigAssayMethodProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } + } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java index 0b2d28c..ea59198 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigProjectMapper.java @@ -2,9 +2,15 @@ package com.zt.plat.module.qms.business.config.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.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigProjectDO; +import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -27,4 +33,21 @@ public interface ConfigProjectMapper extends BaseMapperX { .orderByDesc(ConfigProjectDO::getId)); } + /** + * 根据检测方法查询检测项目 + * @param configAssayMethodId + * @return + */ + default List selectByConfigAssayMethodId(Long configAssayMethodId) { + return selectJoinList(ConfigProjectExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigAssayMethodProjectDO.class, on -> on.eq(ConfigAssayMethodProjectDO::getConfigAssayMethodId, ConfigProjectDO::getConfigAssayMethodId).eq(ConfigAssayMethodProjectDO::getDictionaryProjectId, ConfigProjectDO::getDictionaryProjectId)) + .leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, ConfigProjectDO::getDictionaryProjectId) + .selectAll(ConfigProjectDO.class) + .selectAs(ConfigAssayMethodProjectDO::getId, ConfigProjectExtendRespVO::getConfigAssayMethodProjectId) + .selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, ConfigProjectExtendRespVO::getDictionaryProjectUnit) + .selectAs(DictionaryProjectDO::getKey, ConfigProjectExtendRespVO::getDictionaryProjectKey) + .selectAs(DictionaryProjectDO::getSimpleName, ConfigProjectExtendRespVO::getDictionaryProjectSimpleName) + .selectAs(DictionaryProjectDO::getShowName, ConfigProjectExtendRespVO::getDictionaryProjectShowName) + .eq(ConfigProjectDO::getConfigAssayMethodId, configAssayMethodId)); + } } \ No newline at end of file diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java index c836dec..4f953bc 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigReportFieldMapper.java @@ -26,14 +26,15 @@ public interface ConfigReportFieldMapper extends BaseMapperX selectByConfigReportTypeIds(List configReportTypeIds) { + default List selectByConfigReportTypeIds(List configReportTypeIds, List fieldTypes) { return selectList(new LambdaQueryWrapperX() - .in(ConfigReportFieldDO::getConfigReportTypeId, configReportTypeIds) + .inIfPresent(ConfigReportFieldDO::getConfigReportTypeId, configReportTypeIds) + .inIfPresent(ConfigReportFieldDO::getFieldType, fieldTypes) .orderByAsc(ConfigReportFieldDO::getNo)); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java index 364bc3c..8b3e802 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigRuleMapper.java @@ -23,7 +23,7 @@ public interface ConfigRuleMapper extends BaseMapperX { .likeIfPresent(ConfigRuleDO::getName, reqVO.getName()) .eqIfPresent(ConfigRuleDO::getDescription, reqVO.getDescription()) .eqIfPresent(ConfigRuleDO::getType, reqVO.getType()) - .eqIfPresent(ConfigRuleDO::getEXPRESSION, reqVO.getEXPRESSION()) + .eqIfPresent(ConfigRuleDO::getExpression, reqVO.getExpression()) .eqIfPresent(ConfigRuleDO::getVersion, reqVO.getVersion()) .eqIfPresent(ConfigRuleDO::getIsLast, reqVO.getIsLast()) .eqIfPresent(ConfigRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java index fd1f1f3..d38332e 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/config/dal/mapper/ConfigSampleReportMapper.java @@ -2,9 +2,14 @@ package com.zt.plat.module.qms.business.config.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.query.MPJLambdaWrapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportPageReqVO; +import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportTypeDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleReportDO; + +import java.util.List; + import org.apache.ibatis.annotations.Mapper; import com.zt.plat.module.qms.business.config.controller.vo.*; @@ -29,4 +34,21 @@ public interface ConfigSampleReportMapper extends BaseMapperX selectList(ConfigSampleReportReqVO reqVO) { + return selectJoinList(ConfigSampleReportExtendRespVO.class, new MPJLambdaWrapperX() + .leftJoin(ConfigReportTypeDO.class, ConfigReportTypeDO::getId, ConfigSampleReportDO::getConfigReportTypeId) + .selectAll(ConfigSampleReportDO.class) + .selectAs(ConfigReportTypeDO::getId, ConfigSampleReportExtendRespVO::getConfigReportTypeId) + .selectAs(ConfigReportTypeDO::getKey, ConfigSampleReportExtendRespVO::getConfigReportTypeKey) + .selectAs(ConfigReportTypeDO::getName, ConfigSampleReportExtendRespVO::getConfigReportTypeName) + .eqIfPresent(ConfigSampleReportDO::getConfigReportTypeId, reqVO.getConfigReportTypeId()) + .eqIfPresent(ConfigSampleReportDO::getConfigBaseSampleId, reqVO.getConfigBaseSampleId()) + .likeIfPresent(ConfigSampleReportDO::getSampleName, reqVO.getSampleName()) + .eqIfPresent(ConfigSampleReportDO::getDataSource, reqVO.getDataSource()) + .eqIfPresent(ConfigSampleReportDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) + .betweenIfPresent(ConfigSampleReportDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(ConfigSampleReportDO::getRemark, reqVO.getRemark()) + .eqIfPresent(ConfigSampleReportDO::getVersion, reqVO.getVersion()) + .orderByDesc(ConfigSampleReportDO::getId)); + } } \ No newline at end of file