荧光采集

This commit is contained in:
2025-11-13 13:54:28 +08:00
parent c79590d36e
commit 6e0886ca5b
39 changed files with 2325 additions and 0 deletions

View File

@@ -62,6 +62,10 @@ public interface ErrorCodeConstants {
ErrorCode CONFIG_SIMPLE_FLOW_CODE_NOT_EXISTS = new ErrorCode(1_032_050_000, "LiteFlow脚本配置不存在");
ErrorCode CONFIG_RULE_NOT_EXISTS = new ErrorCode(1_032_050_000, "规则配置不存在");
ErrorCode CONFIG_XRF_LINE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光分析线不存在");
ErrorCode CONFIG_XRF_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光采集检测项目配置不存在");
ErrorCode CONFIG_XRF_CONVERSION_RATE_NOT_EXISTS = new ErrorCode(1_032_050_000, "荧光数据采集特殊检测项目转换率配置不存在");
ErrorCode BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品大类管理不存在");
ErrorCode MATERIAL_ASSAY_STANDARD_DETAIL_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测标准明细不存在");
ErrorCode MATERIAL_ASSAY_STANDARD_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测标准不存在");
@@ -124,6 +128,8 @@ public interface ErrorCodeConstants {
ErrorCode BUSINESS_QC_COEFFICIENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数任务数据,空白样、标样不存在");
ErrorCode BUSINESS_QC_COEFFICIENT_PARAMETER_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "质控样检测系数参数业务不存在");
ErrorCode BUSINESS_XRF_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "荧光采集记录不存在");
//检测报告
ErrorCode REPORT_DOCUMENT_MAIN_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告业务不存在");

View File

@@ -0,0 +1,79 @@
package com.zt.plat.module.qms.business.bus.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 BusinessXRFDataPageReqVO extends PageParam {
@Schema(description = "设备编号")
private Long deviceNo;
@Schema(description = "荧光线名称", example = "王五")
private String lineName;
@Schema(description = "荧光样品id", example = "13273")
private String xRFSampleId;
@Schema(description = "样品编号")
private String sampleCode;
@Schema(description = "样品名称", example = "李四")
private String sampleName;
@Schema(description = "样品时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] sampleTime;
@Schema(description = "分析人")
private String assayOperator;
@Schema(description = "样品主样ID", example = "29288")
private Long businessBaseSampleId;
@Schema(description = "样品分样ID", example = "4878")
private Long businessSubParentSampleId;
@Schema(description = "分样子样ID", example = "13189")
private Long businessSubSampleId;
@Schema(description = "检测数据")
private String assayData;
@Schema(description = "是否为检查创建数据")
private Integer isCheckCreate;
@Schema(description = "是否已匹配")
private Integer isMatched;
@Schema(description = "是否已上报")
private Integer isReported;
@Schema(description = "上报人")
private String reporter;
@Schema(description = "上报时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] reportTime;
@Schema(description = "乐观锁", example = "4171")
private Integer updateCount;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,99 @@
package com.zt.plat.module.qms.business.bus.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 荧光采集记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class BusinessXRFDataRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701")
@ExcelProperty("ID")
private Long id;
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("设备编号")
private Long deviceNo;
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("荧光线名称")
private String lineName;
@Schema(description = "荧光样品id", example = "13273")
@ExcelProperty("荧光样品id")
private String xRFSampleId;
@Schema(description = "样品编号")
@ExcelProperty("样品编号")
private String sampleCode;
@Schema(description = "样品名称", example = "李四")
@ExcelProperty("样品名称")
private String sampleName;
@Schema(description = "样品时间")
@ExcelProperty("样品时间")
private LocalDateTime sampleTime;
@Schema(description = "分析人")
@ExcelProperty("分析人")
private String assayOperator;
@Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288")
@ExcelProperty("样品主样ID")
private Long businessBaseSampleId;
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878")
@ExcelProperty("样品分样ID")
private Long businessSubParentSampleId;
@Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189")
@ExcelProperty("分样子样ID")
private Long businessSubSampleId;
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("检测数据")
private String assayData;
@Schema(description = "是否为检查创建数据")
@ExcelProperty("是否为检查创建数据")
private Integer isCheckCreate;
@Schema(description = "是否已匹配")
@ExcelProperty("是否已匹配")
private Integer isMatched;
@Schema(description = "是否已上报")
@ExcelProperty("是否已上报")
private Integer isReported;
@Schema(description = "上报人")
@ExcelProperty("上报人")
private String reporter;
@Schema(description = "上报时间")
@ExcelProperty("上报时间")
private LocalDateTime reportTime;
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171")
@ExcelProperty("乐观锁")
private Integer updateCount;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "备注")
@ExcelProperty("备注")
private String remark;
}

View File

@@ -0,0 +1,81 @@
package com.zt.plat.module.qms.business.bus.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 荧光采集记录新增/修改 Request VO")
@Data
public class BusinessXRFDataSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18701")
private Long id;
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "设备编号不能为空")
private Long deviceNo;
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "荧光线名称不能为空")
private String lineName;
@Schema(description = "荧光样品id", example = "13273")
private String xRFSampleId;
@Schema(description = "样品编号")
private String sampleCode;
@Schema(description = "样品名称", example = "李四")
private String sampleName;
@Schema(description = "样品时间")
private LocalDateTime sampleTime;
@Schema(description = "分析人")
private String assayOperator;
@Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29288")
@NotNull(message = "样品主样ID不能为空")
private Long businessBaseSampleId;
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4878")
@NotNull(message = "样品分样ID不能为空")
private Long businessSubParentSampleId;
@Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13189")
@NotNull(message = "分样子样ID不能为空")
private Long businessSubSampleId;
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "检测数据不能为空")
private String assayData;
@Schema(description = "是否为检查创建数据")
private Integer isCheckCreate;
@Schema(description = "是否已匹配")
private Integer isMatched;
@Schema(description = "是否已上报")
private Integer isReported;
@Schema(description = "上报人")
private String reporter;
@Schema(description = "上报时间")
private LocalDateTime reportTime;
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "4171")
@NotNull(message = "乐观锁不能为空")
private Integer updateCount;
@Schema(description = "所属部门")
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -0,0 +1,42 @@
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.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
/**
* 荧光采集记录 Mapper
*
* @author 后台管理
*/
@Mapper
public interface BusinessXRFDataMapper extends BaseMapperX<BusinessXRFDataDO> {
default PageResult<BusinessXRFDataDO> selectPage(BusinessXRFDataPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessXRFDataDO>()
.eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo())
.likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName())
.eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId())
.eqIfPresent(BusinessXRFDataDO::getSampleCode, reqVO.getSampleCode())
.likeIfPresent(BusinessXRFDataDO::getSampleName, reqVO.getSampleName())
.betweenIfPresent(BusinessXRFDataDO::getSampleTime, reqVO.getSampleTime())
.eqIfPresent(BusinessXRFDataDO::getAssayOperator, reqVO.getAssayOperator())
.eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
.eqIfPresent(BusinessXRFDataDO::getIsReported, reqVO.getIsReported())
.eqIfPresent(BusinessXRFDataDO::getReporter, reqVO.getReporter())
.betweenIfPresent(BusinessXRFDataDO::getReportTime, reqVO.getReportTime())
.eqIfPresent(BusinessXRFDataDO::getUpdateCount, reqVO.getUpdateCount())
.eqIfPresent(BusinessXRFDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(BusinessXRFDataDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessXRFDataDO::getRemark, reqVO.getRemark())
.orderByDesc(BusinessXRFDataDO::getId));
}
}

View File

@@ -0,0 +1,61 @@
package com.zt.plat.module.qms.business.bus.service;
import java.util.*;
import jakarta.validation.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
/**
* 荧光采集记录 Service 接口
*
* @author 后台管理
*/
public interface BusinessXRFDataService {
/**
* 创建荧光采集记录
*
* @param createReqVO 创建信息
* @return 编号
*/
BusinessXRFDataRespVO createBusinessXRFData(@Valid BusinessXRFDataSaveReqVO createReqVO);
/**
* 更新荧光采集记录
*
* @param updateReqVO 更新信息
*/
void updateBusinessXRFData(@Valid BusinessXRFDataSaveReqVO updateReqVO);
/**
* 删除荧光采集记录
*
* @param id 编号
*/
void deleteBusinessXRFData(Long id);
/**
* 批量删除荧光采集记录
*
* @param ids 编号
*/
void deleteBusinessXRFDataListByIds(List<Long> ids);
/**
* 获得荧光采集记录
*
* @param id 编号
* @return 荧光采集记录
*/
BusinessXRFDataDO getBusinessXRFData(Long id);
/**
* 获得荧光采集记录分页
*
* @param pageReqVO 分页查询
* @return 荧光采集记录分页
*/
PageResult<BusinessXRFDataDO> getBusinessXRFDataPage(BusinessXRFDataPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,91 @@
package com.zt.plat.module.qms.business.bus.service;
import cn.hutool.core.collection.CollUtil;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
/**
* 荧光采集记录 Service 实现类
*
* @author 后台管理
*/
@Service
@Validated
public class BusinessXRFDataServiceImpl implements BusinessXRFDataService {
@Resource
private BusinessXRFDataMapper businessXRFDataMapper;
@Override
public BusinessXRFDataRespVO createBusinessXRFData(BusinessXRFDataSaveReqVO createReqVO) {
// 插入
BusinessXRFDataDO businessXRFData = BeanUtils.toBean(createReqVO, BusinessXRFDataDO.class);
businessXRFDataMapper.insert(businessXRFData);
// 返回
return BeanUtils.toBean(businessXRFData, BusinessXRFDataRespVO.class);
}
@Override
public void updateBusinessXRFData(BusinessXRFDataSaveReqVO updateReqVO) {
// 校验存在
validateBusinessXRFDataExists(updateReqVO.getId());
// 更新
BusinessXRFDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessXRFDataDO.class);
businessXRFDataMapper.updateById(updateObj);
}
@Override
public void deleteBusinessXRFData(Long id) {
// 校验存在
validateBusinessXRFDataExists(id);
// 删除
businessXRFDataMapper.deleteById(id);
}
@Override
public void deleteBusinessXRFDataListByIds(List<Long> ids) {
// 校验存在
validateBusinessXRFDataExists(ids);
// 删除
businessXRFDataMapper.deleteByIds(ids);
}
private void validateBusinessXRFDataExists(List<Long> ids) {
List<BusinessXRFDataDO> list = businessXRFDataMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(BUSINESS_XRF_DATA_NOT_EXISTS);
}
}
private void validateBusinessXRFDataExists(Long id) {
if (businessXRFDataMapper.selectById(id) == null) {
throw exception(BUSINESS_XRF_DATA_NOT_EXISTS);
}
}
@Override
public BusinessXRFDataDO getBusinessXRFData(Long id) {
return businessXRFDataMapper.selectById(id);
}
@Override
public PageResult<BusinessXRFDataDO> getBusinessXRFDataPage(BusinessXRFDataPageReqVO pageReqVO) {
return businessXRFDataMapper.selectPage(pageReqVO);
}
}

Some files were not shown because too many files have changed in this diff Show More