荧光数据接口
This commit is contained in:
@@ -31,7 +31,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 荧光采集记录")
|
||||
@RestController
|
||||
@RequestMapping("/qms/business-XRF-data")
|
||||
@RequestMapping("/qms/business-xrf-data")
|
||||
@Validated
|
||||
public class BusinessXRFDataController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@@ -63,6 +63,10 @@ public class BatchSampleAnalysisColumnRespVO implements Serializable {
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 类型(project:元素,parameter:参数) **/
|
||||
@Schema(description = "类型(project:元素,parameter:参数)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "填写方式")
|
||||
private String fillingWay;
|
||||
|
||||
|
||||
@@ -54,8 +54,8 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable {
|
||||
@Schema(description = "元素或参数配置参数编号")
|
||||
private Integer paramNo;
|
||||
|
||||
/** 类型(1:元素,2:参数) **/
|
||||
@Schema(description = "类型(project:元素,2:参数)")
|
||||
/** 类型(project:元素,parameter:参数) **/
|
||||
@Schema(description = "类型(project:元素,parameter:参数)")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "填写方式")
|
||||
|
||||
@@ -14,7 +14,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class BusinessXRFDataPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", example = "王五")
|
||||
private String lineName;
|
||||
@@ -44,6 +44,9 @@ public class BusinessXRFDataPageReqVO extends PageParam {
|
||||
@Schema(description = "分样子样ID", example = "13189")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "检测任务ID", example = "16505")
|
||||
private Long businessAssayTaskDataId;
|
||||
|
||||
@Schema(description = "检测数据")
|
||||
private String assayData;
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
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 BusinessXRFDataReqVO {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", example = "王五")
|
||||
private String lineName;
|
||||
|
||||
@Schema(description = "荧光样品id", example = "13273")
|
||||
private String xRFSampleId;
|
||||
|
||||
@Schema(description = "荧光样品id列表")
|
||||
private List<String> xRFSampleIdList;
|
||||
|
||||
@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 = "检测任务ID", example = "16505")
|
||||
private Long businessAssayTaskDataId;
|
||||
|
||||
@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;
|
||||
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public class BusinessXRFDataRespVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("荧光线名称")
|
||||
@@ -56,6 +56,9 @@ public class BusinessXRFDataRespVO {
|
||||
@ExcelProperty("分样子样ID")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "检测任务ID", example = "16505")
|
||||
private Long businessAssayTaskDataId;
|
||||
|
||||
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("检测数据")
|
||||
private String assayData;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BusinessXRFDataSaveReqVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "设备编号不能为空")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "荧光线名称不能为空")
|
||||
@@ -49,6 +49,9 @@ public class BusinessXRFDataSaveReqVO {
|
||||
@NotNull(message = "分样子样ID不能为空")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "检测任务ID", example = "16505")
|
||||
private Long businessAssayTaskDataId;
|
||||
|
||||
@Schema(description = "检测数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "检测数据不能为空")
|
||||
private String assayData;
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BusinessXRFDataDO extends BusinessBaseDO {
|
||||
* 设备编号
|
||||
*/
|
||||
@TableField("DEV_NO")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
/**
|
||||
* 荧光线名称
|
||||
*/
|
||||
@@ -84,6 +84,11 @@ public class BusinessXRFDataDO extends BusinessBaseDO {
|
||||
@TableField("BSN_SB_SMP_ID")
|
||||
private Long businessSubSampleId;
|
||||
/**
|
||||
* 检测任务ID
|
||||
*/
|
||||
@TableField("BSN_ASY_TSK_DAT_ID")
|
||||
private Long businessAssayTaskDataId;
|
||||
/**
|
||||
* 检测数据
|
||||
*/
|
||||
@TableField("ASY_DAT")
|
||||
|
||||
@@ -119,6 +119,17 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
.eq(BusinessAssayTaskDataDO::getId, businessAssayTaskDataId));
|
||||
}
|
||||
|
||||
default BusinessAssayTaskDataExtendRespVO selectBySampleCode(String sampleCode) {
|
||||
return selectJoinOne(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.eq(BusinessSubSampleDO::getSampleAssayCode, sampleCode)
|
||||
.eq(BusinessAssayTaskDataDO::getIsReported, QmsCommonConstant.NO));
|
||||
}
|
||||
|
||||
default List<BusinessAssayTaskDataExtendRespVO> selectResultAssessmentList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapper<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||
@@ -320,4 +331,5 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
*/
|
||||
List<UnAssignTaskedSubSampleRespVO> selectUnAssignTaskedSubSample();
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,9 @@ 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 java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 荧光采集记录 Mapper
|
||||
@@ -26,6 +29,34 @@ public interface BusinessXRFDataMapper extends BaseMapperX<BusinessXRFDataDO> {
|
||||
.eqIfPresent(BusinessXRFDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessXRFDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||
.eqIfPresent(BusinessXRFDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
||||
.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));
|
||||
}
|
||||
|
||||
default List<BusinessXRFDataDO> selectList(BusinessXRFDataReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessXRFDataDO>()
|
||||
.eqIfPresent(BusinessXRFDataDO::getDeviceNo, reqVO.getDeviceNo())
|
||||
.likeIfPresent(BusinessXRFDataDO::getLineName, reqVO.getLineName())
|
||||
.eqIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleId())
|
||||
.inIfPresent(BusinessXRFDataDO::getXRFSampleId, reqVO.getXRFSampleIdList())
|
||||
.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::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
|
||||
.eqIfPresent(BusinessXRFDataDO::getAssayData, reqVO.getAssayData())
|
||||
.eqIfPresent(BusinessXRFDataDO::getIsCheckCreate, reqVO.getIsCheckCreate())
|
||||
.eqIfPresent(BusinessXRFDataDO::getIsMatched, reqVO.getIsMatched())
|
||||
|
||||
@@ -291,6 +291,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
} else {
|
||||
isCreateZhy = true;
|
||||
MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId);
|
||||
if (materialAssayStandardMethodDO == null) {
|
||||
throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置");
|
||||
}
|
||||
configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId());
|
||||
}
|
||||
|
||||
|
||||
@@ -402,6 +402,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
datas.add(map);
|
||||
}
|
||||
|
||||
resultJsonObject.put("all", datas);
|
||||
Map<String, List<Map<String, Object>>> map = datas.stream().collect(Collectors.groupingBy(g -> (String) g.get("analysisType")));
|
||||
for (Map.Entry<String, List<Map<String, Object>>> entry : map.entrySet()) {
|
||||
resultJsonObject.put(entry.getKey(), entry.getValue());
|
||||
|
||||
@@ -150,8 +150,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
||||
|
||||
|
||||
@@ -167,7 +167,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(), ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
@@ -177,7 +177,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(), p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -406,8 +406,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
//cloumns.add(new BatchSampleAnalysisColumnRespVO("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
|
||||
|
||||
|
||||
@@ -422,7 +422,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(), ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
@@ -432,7 +432,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(), p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -492,8 +492,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleCode", "sampleCode", "样品编号", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
|
||||
//处理数据
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
@@ -511,7 +511,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
String fieldIndex = "p" + p.getDicId();
|
||||
String title = p.getShowName() + (StringUtils.isBlank(p.getUnit()) ? "" : "(" + p.getUnit() + ")");
|
||||
boolean 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(), p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
|
||||
|
||||
@@ -551,7 +551,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(), ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", ep.getDataType(), ep.getDecimalPosition(), null, ep.getFormula(), ep.getParamNo(), isEdit, ep.getUnit(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO();
|
||||
@@ -561,7 +561,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(), p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 荧光数据采集特殊检测项目转换率配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-XRF-conversion-rate")
|
||||
@RequestMapping("/qms/config-xrf-conversion-rate")
|
||||
@Validated
|
||||
public class ConfigXRFConversionRateController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 荧光分析线")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-XRF-line")
|
||||
@RequestMapping("/qms/config-xrf-line")
|
||||
@Validated
|
||||
public class ConfigXRFLineController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 荧光采集检测项目配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-XRF-project")
|
||||
@RequestMapping("/qms/config-xrf-project")
|
||||
@Validated
|
||||
public class ConfigXRFProjectController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class ConfigXRFConversionRatePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", example = "张三")
|
||||
private String lineName;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ConfigXRFConversionRateRespVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("荧光线名称")
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ConfigXRFConversionRateSaveReqVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "设备编号不能为空")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "荧光线名称不能为空")
|
||||
|
||||
@@ -14,7 +14,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class ConfigXRFLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", example = "芋艿")
|
||||
private String lineName;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ConfigXRFLineRespVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("荧光线名称")
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ConfigXRFLineSaveReqVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "设备编号不能为空")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "荧光线名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "荧光线名称不能为空")
|
||||
|
||||
@@ -14,7 +14,7 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class ConfigXRFProjectPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "12325")
|
||||
private Long dictionaryProjectId;
|
||||
@@ -37,6 +37,9 @@ public class ConfigXRFProjectPageReqVO extends PageParam {
|
||||
@Schema(description = "转换率(乘数)")
|
||||
private Integer conversionRate;
|
||||
|
||||
@Schema(description = "上报列字段")
|
||||
private String saveColumn;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ConfigXRFProjectRespVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备编号")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325")
|
||||
@ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】")
|
||||
@@ -48,6 +48,9 @@ public class ConfigXRFProjectRespVO {
|
||||
@ExcelProperty("转换率(乘数)")
|
||||
private Integer conversionRate;
|
||||
|
||||
@Schema(description = "上报列字段")
|
||||
private String saveColumn;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
@ExcelProperty("排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ConfigXRFProjectSaveReqVO {
|
||||
|
||||
@Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "设备编号不能为空")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "12325")
|
||||
@NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空")
|
||||
@@ -38,6 +38,9 @@ public class ConfigXRFProjectSaveReqVO {
|
||||
@Schema(description = "转换率(乘数)")
|
||||
private Integer conversionRate;
|
||||
|
||||
@Schema(description = "上报列字段")
|
||||
private String saveColumn;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ConfigXRFConversionRateDO extends BusinessBaseDO {
|
||||
* 设备编号
|
||||
*/
|
||||
@TableField("DEV_NO")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
/**
|
||||
* 荧光线名称
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ public class ConfigXRFLineDO extends BusinessBaseDO {
|
||||
* 设备编号
|
||||
*/
|
||||
@TableField("DEV_NO")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
/**
|
||||
* 荧光线名称
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ConfigXRFProjectDO extends BusinessBaseDO {
|
||||
* 设备编号
|
||||
*/
|
||||
@TableField("DEV_NO")
|
||||
private Long deviceNo;
|
||||
private String deviceNo;
|
||||
/**
|
||||
* 检测项目ID,字典表【T_DIC_PRJ】
|
||||
*/
|
||||
@@ -72,6 +72,11 @@ public class ConfigXRFProjectDO extends BusinessBaseDO {
|
||||
@TableField("CNV_RTE")
|
||||
private Integer conversionRate;
|
||||
/**
|
||||
* 上报列字段
|
||||
*/
|
||||
@TableField("SVE_COLN")
|
||||
private String saveColumn;
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@TableField("SRT_NO")
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
@@ -29,4 +27,11 @@ public interface ConfigXRFConversionRateMapper extends BaseMapperX<ConfigXRFConv
|
||||
.orderByDesc(ConfigXRFConversionRateDO::getId));
|
||||
}
|
||||
|
||||
default ConfigXRFConversionRateDO selectBy(String deviceNo, String lineName, String projectName) {
|
||||
return selectOne(new LambdaQueryWrapperX<ConfigXRFConversionRateDO>()
|
||||
.eq(ConfigXRFConversionRateDO::getDeviceNo, deviceNo)
|
||||
.eq(ConfigXRFConversionRateDO::getLineName, lineName)
|
||||
.eq(ConfigXRFConversionRateDO::getXRFProjectName, projectName));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -32,4 +33,17 @@ public interface ConfigXRFLineMapper extends BaseMapperX<ConfigXRFLineDO> {
|
||||
.orderByDesc(ConfigXRFLineDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigXRFLineDO> selectByDeviceNo(String deviceNo) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigXRFLineDO>()
|
||||
.eq(ConfigXRFLineDO::getDeviceNo, deviceNo)
|
||||
.eq(ConfigXRFLineDO::getIsUse, QmsCommonConstant.YES));
|
||||
}
|
||||
|
||||
default ConfigXRFLineDO selectByDeviceNoAndLineName(String deviceNo, String lineName) {
|
||||
return selectOne(new LambdaQueryWrapperX<ConfigXRFLineDO>()
|
||||
.eq(ConfigXRFLineDO::getDeviceNo, deviceNo)
|
||||
.eq(ConfigXRFLineDO::getLineName, lineName)
|
||||
.eq(ConfigXRFLineDO::getIsUse, QmsCommonConstant.YES));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,4 +34,9 @@ public interface ConfigXRFProjectMapper extends BaseMapperX<ConfigXRFProjectDO>
|
||||
.orderByDesc(ConfigXRFProjectDO::getId));
|
||||
}
|
||||
|
||||
default List<ConfigXRFProjectDO> selectByDeviceNo(String deviceNo) {
|
||||
return selectList(new LambdaQueryWrapperX<ConfigXRFProjectDO>()
|
||||
.eq(ConfigXRFProjectDO::getDeviceNo, deviceNo));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.qms.thirdpartyapi.controller.admin;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigXRFLineRespVO;
|
||||
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*;
|
||||
import com.zt.plat.module.qms.thirdpartyapi.service.XRFDataService;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/qms/thirdpartyapi/xrf-data")
|
||||
public class XRFDataController {
|
||||
|
||||
@Resource
|
||||
private XRFDataService xrfDataService;
|
||||
|
||||
@GetMapping("/xrf-line-list")
|
||||
public CommonResult<?> getXrfLineList(@RequestParam("deviceNo") String deviceNo) {
|
||||
List<ConfigXRFLineRespVO> list = xrfDataService.getXrfLineList(deviceNo);
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/submit-xrf-data")
|
||||
public CommonResult<?> submitXrfData(@RequestBody List<XRFDeviceSampleReqVO> reqList) {
|
||||
if (CollUtil.isEmpty(reqList)) {
|
||||
return CommonResult.error(1_032_001_000, "请求参数不允许为空");
|
||||
}
|
||||
int count = xrfDataService.submitXrfData(reqList);
|
||||
return CommonResult.success(count);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class XRFDeviceSampleProjectReqVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 6853465669006150205L;
|
||||
|
||||
/**
|
||||
* 检测项目名称
|
||||
*/
|
||||
@Schema(description = "检测项目名称")
|
||||
private String xRFProjectName;
|
||||
|
||||
/**
|
||||
* 检测项目单位
|
||||
*/
|
||||
@Schema(description = "检测项目单位")
|
||||
private String xRFProjectUnit;
|
||||
|
||||
/**
|
||||
* 检测项目值
|
||||
*/
|
||||
@Schema(description = "检测项目值")
|
||||
private String xRFProjectValue;
|
||||
|
||||
/**
|
||||
* 小数位数
|
||||
*/
|
||||
@Schema(description = "小数位数")
|
||||
private Integer valueDecimals;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.zt.plat.module.qms.thirdpartyapi.controller.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class XRFDeviceSampleReqVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3173676626377747618L;
|
||||
|
||||
/**
|
||||
* 设备编号
|
||||
*/
|
||||
@Schema(description = "设备编号")
|
||||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 分析线
|
||||
*/
|
||||
@Schema(description = "分析线")
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 样品id
|
||||
*/
|
||||
@Schema(description = "样品id")
|
||||
private String sampleId;
|
||||
|
||||
/**
|
||||
* 样品编号
|
||||
*/
|
||||
@Schema(description = "样品编号")
|
||||
private String sampleCode;
|
||||
|
||||
/**
|
||||
* 样品时间
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "样品时间")
|
||||
private LocalDateTime sampleTime;
|
||||
|
||||
/**
|
||||
* 分析人
|
||||
*/
|
||||
@Schema(description = "分析人")
|
||||
private String assayOper;
|
||||
|
||||
/**
|
||||
* 分析项目
|
||||
*/
|
||||
@Schema(description = "分析项目")
|
||||
private List<XRFDeviceSampleProjectReqVO> sampleProjects;
|
||||
|
||||
/**
|
||||
* 是否为检查上传
|
||||
*/
|
||||
@Schema(description = "是否为检查上传")
|
||||
private Boolean isCheck;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.zt.plat.module.qms.thirdpartyapi.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigXRFLineRespVO;
|
||||
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.XRFDeviceSampleReqVO;
|
||||
|
||||
public interface XRFDataService {
|
||||
|
||||
List<ConfigXRFLineRespVO> getXrfLineList(String deviceNo);
|
||||
|
||||
int submitXrfData(List<XRFDeviceSampleReqVO> reqList);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package com.zt.plat.module.qms.thirdpartyapi.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.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.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessXRFDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessXRFDataMapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFConversionRateDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFLineDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigXRFProjectDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFConversionRateMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFLineMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigXRFProjectMapper;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.thirdpartyapi.controller.vo.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class XRFDataServiceImpl implements XRFDataService {
|
||||
|
||||
@Resource
|
||||
private ConfigXRFLineMapper configXRFLineMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigXRFProjectMapper configXRFProjectMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigXRFConversionRateMapper configXRFConversionRateMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessXRFDataMapper businessXRFDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||
|
||||
@Override
|
||||
public List<ConfigXRFLineRespVO> getXrfLineList(String deviceNo) {
|
||||
List<ConfigXRFLineDO> list = configXRFLineMapper.selectByDeviceNo(deviceNo);
|
||||
return BeanUtils.toBean(list, ConfigXRFLineRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int submitXrfData(List<XRFDeviceSampleReqVO> reqList) {
|
||||
Map<String, List<XRFDeviceSampleReqVO>> reqLineMap = reqList.stream().collect(Collectors.groupingBy(XRFDeviceSampleReqVO::getLineName));
|
||||
for (Map.Entry<String, List<XRFDeviceSampleReqVO>> entry : reqLineMap.entrySet()) {
|
||||
String lineName = entry.getKey();
|
||||
List<XRFDeviceSampleReqVO> xrfDeviceSampleList = entry.getValue();
|
||||
XRFDeviceSampleReqVO xrfDeviceSampleFirst = xrfDeviceSampleList.get(0);
|
||||
|
||||
//获取最大时间
|
||||
LocalDateTime maxSampleTime = xrfDeviceSampleList.stream().max(Comparator.comparing(XRFDeviceSampleReqVO::getSampleTime)).map(XRFDeviceSampleReqVO::getSampleTime).get();
|
||||
|
||||
//获取荧光样品id列表
|
||||
List<String> sampleIdList = xrfDeviceSampleList.stream().map(XRFDeviceSampleReqVO::getSampleId).collect(Collectors.toList());
|
||||
|
||||
//查询数据库是否已保存了荧光数据
|
||||
BusinessXRFDataReqVO existXRFDataSearch = new BusinessXRFDataReqVO();
|
||||
existXRFDataSearch.setDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
||||
existXRFDataSearch.setLineName(lineName);
|
||||
existXRFDataSearch.setXRFSampleIdList(sampleIdList);
|
||||
List<BusinessXRFDataDO> existBusYgDataList = businessXRFDataMapper.selectList(existXRFDataSearch);
|
||||
//已存在数据库中的样品id
|
||||
List<String> existSampleIdList = new ArrayList<>();
|
||||
for (BusinessXRFDataDO qmsBusYgData : existBusYgDataList) {
|
||||
existSampleIdList.add(qmsBusYgData.getXRFSampleId());
|
||||
}
|
||||
//根据设备编号查询荧光元素配置
|
||||
List<ConfigXRFProjectDO> conYgElementList = configXRFProjectMapper.selectByDeviceNo(xrfDeviceSampleFirst.getDeviceNo());
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayProjectDataDO> busElementValueList = new ArrayList<>();
|
||||
List<BusinessXRFDataDO> busYgDataList = new ArrayList<>();
|
||||
BusinessXRFDataDO busYgData = null;
|
||||
for (XRFDeviceSampleReqVO ygDeviceSample : xrfDeviceSampleList) {
|
||||
if (existSampleIdList.contains(ygDeviceSample.getSampleId())) {
|
||||
continue;
|
||||
}
|
||||
//分析元素
|
||||
List<XRFDeviceSampleProjectReqVO> sampleElements = ygDeviceSample.getSampleProjects();
|
||||
if (sampleElements == null) {
|
||||
log.info("分析元素为空!", JSON.toJSONString(ygDeviceSample));
|
||||
continue;
|
||||
}
|
||||
busYgData = new BusinessXRFDataDO();
|
||||
busYgData.setDeviceNo(ygDeviceSample.getDeviceNo());
|
||||
busYgData.setLineName(ygDeviceSample.getLineName());
|
||||
busYgData.setXRFSampleId(ygDeviceSample.getSampleId());
|
||||
busYgData.setSampleCode(ygDeviceSample.getSampleCode());
|
||||
busYgData.setSampleTime(ygDeviceSample.getSampleTime());
|
||||
busYgData.setAssayOperator(ygDeviceSample.getAssayOper());
|
||||
busYgData.setIsCheckCreate(ygDeviceSample.getIsCheck() ? 1 : 0);
|
||||
|
||||
|
||||
//处理匹配
|
||||
List<BusinessAssayProjectDataExtendRespVO> tempBusElementValueList = new ArrayList<>();
|
||||
BusinessAssayTaskDataExtendRespVO businessAssayTaskData = businessAssayTaskDataMapper.selectBySampleCode(ygDeviceSample.getSampleCode());
|
||||
if (businessAssayTaskData != null) {
|
||||
List<BusinessAssayProjectDataExtendRespVO> busElementValues = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||
tempBusElementValueList.addAll(busElementValues);
|
||||
}
|
||||
|
||||
//分析元素
|
||||
for (XRFDeviceSampleProjectReqVO ygDeviceSampleElement : sampleElements) {
|
||||
|
||||
//如果设备上来的元素值为空,则跳过继续
|
||||
if (ygDeviceSampleElement.getXRFProjectValue() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//查询是否有特殊转换率
|
||||
// QmsConYgConverRate conYgConverRate = conYgConverRateService.getOne(Wrappers.<QmsConYgConverRate>query().lambda().eq(QmsConYgConverRate::getDeviceNo, ygDeviceSample.getDeviceNo())
|
||||
// .eq(QmsConYgConverRate::getLineName, ygDeviceSample.getLineName()).eq(QmsConYgConverRate::getElementName, ygDeviceSampleElement.getElementName()));
|
||||
ConfigXRFConversionRateDO conYgConverRate = configXRFConversionRateMapper.selectBy(ygDeviceSample.getDeviceNo(), ygDeviceSample.getLineName(), ygDeviceSampleElement.getXRFProjectName());
|
||||
|
||||
ConfigXRFProjectDO conYgElement = null;
|
||||
if(conYgConverRate != null && conYgConverRate.getConversionRate() != null) {
|
||||
conYgElement = conYgElementList.stream().filter(f -> f.getXRFProjectName().equals(ygDeviceSampleElement.getXRFProjectName()) && f.getConversionRate().equals(conYgConverRate.getConversionRate())).findFirst().orElse(null);
|
||||
} else {
|
||||
conYgElement = conYgElementList.stream().filter(f -> f.getXRFProjectName().equals(ygDeviceSampleElement.getXRFProjectName()) && (StringUtils.isBlank(f.getXRFProjectUnit()) || StringUtils.isBlank(ygDeviceSampleElement.getXRFProjectUnit()) || f.getXRFProjectUnit().equals(ygDeviceSampleElement.getXRFProjectUnit()))).findFirst().orElse(null);
|
||||
}
|
||||
if(conYgElement != null) {
|
||||
//数据转换
|
||||
BigDecimal elementValue = BigDecimal.ZERO;
|
||||
Integer conYgElementDataType = 0;
|
||||
if(conYgConverRate != null && conYgConverRate.getConversionRate() != null) {
|
||||
BigDecimal convertRate = new BigDecimal(conYgConverRate.getConversionRate().toString());
|
||||
elementValue = new BigDecimal(ygDeviceSampleElement.getXRFProjectValue()).multiply(convertRate);
|
||||
} else {
|
||||
BigDecimal convertRate = new BigDecimal(conYgElement.getConversionRate().toString());
|
||||
elementValue = new BigDecimal(ygDeviceSampleElement.getXRFProjectValue()).multiply(convertRate);
|
||||
}
|
||||
if(elementValue.compareTo(BigDecimal.ZERO) < 0) {
|
||||
elementValue = BigDecimal.ZERO;
|
||||
}
|
||||
if(conYgElement.getDataType() != null && "decimal".equals(conYgElement.getDataType())) {
|
||||
conYgElementDataType = conYgElement.getDecimalPosition();
|
||||
}
|
||||
Long elementId = conYgElement.getDictionaryProjectId();
|
||||
BusinessAssayProjectDataExtendRespVO busElementValue = tempBusElementValueList.stream().filter(f -> f.getDictionaryProjectId().equals(elementId) && f.getIsEnabled().equals(1)).findFirst().orElse(null);
|
||||
if (busElementValue != null) {
|
||||
//化验数据小数精度四舍六入五单双
|
||||
if("decimal".equals(busElementValue.getDataType())) {
|
||||
busElementValue.setValue(elementValue.setScale(busElementValue.getDecimalPosition(), RoundingMode.HALF_EVEN).toPlainString());
|
||||
} else {
|
||||
busElementValue.setValue(elementValue.setScale(conYgElementDataType, RoundingMode.HALF_EVEN).toPlainString());
|
||||
}
|
||||
busElementValue.setRemark(conYgElement.getShowName() + ": " + busElementValue.getValue());
|
||||
busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class));
|
||||
}
|
||||
|
||||
// if(conYgElementDataType != null && conYgElementDataType.intValue() > -1) {
|
||||
// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue.setScale(conYgElementDataType, BigDecimal.ROUND_HALF_EVEN).toPlainString());//数据格式化-四舍六入五单双
|
||||
// } else {
|
||||
// BeanUtil.setFieldValue(busYgData, conYgElement.getSaveColumn(), elementValue);
|
||||
// }
|
||||
}
|
||||
}
|
||||
//循环元素修改流程节点
|
||||
for (BusinessAssayProjectDataExtendRespVO busElementValue : tempBusElementValueList) {
|
||||
boolean match = busElementValueList.stream().anyMatch(m -> m.getId().equals(busElementValue.getId()));
|
||||
if (!match) {//已经添加过的,不再添加
|
||||
busElementValueList.add(BeanUtils.toBean(busElementValue, BusinessAssayProjectDataDO.class));
|
||||
}
|
||||
}
|
||||
|
||||
if (businessAssayTaskData != null) {
|
||||
busYgData.setIsMatched(QmsCommonConstant.YES);
|
||||
busYgData.setBusinessBaseSampleId(businessAssayTaskData.getBusinessBaseSampleId());
|
||||
busYgData.setBusinessSubParentSampleId(businessAssayTaskData.getBusinessSubParentSampleId());
|
||||
busYgData.setBusinessSubSampleId(businessAssayTaskData.getBusinessSubSampleId());
|
||||
busYgData.setBusinessAssayTaskDataId(businessAssayTaskData.getId());
|
||||
businessAssayTaskDataDOList.add(BeanUtils.toBean(businessAssayTaskData, BusinessAssayTaskDataDO.class));
|
||||
}
|
||||
|
||||
busYgDataList.add(busYgData);
|
||||
}
|
||||
//查询荧光分析线配置
|
||||
ConfigXRFLineDO conYgLine = configXRFLineMapper.selectByDeviceNoAndLineName(xrfDeviceSampleFirst.getDeviceNo(), lineName);
|
||||
if (xrfDeviceSampleFirst.getIsCheck()) {
|
||||
conYgLine.setLastCheckDataTime(maxSampleTime);
|
||||
} else {
|
||||
conYgLine.setLastSynchronousDataTime(maxSampleTime);
|
||||
}
|
||||
//更新配置时间
|
||||
configXRFLineMapper.updateById(conYgLine);
|
||||
if (busYgDataList.size() > 0) {
|
||||
|
||||
//保存荧光数据
|
||||
businessXRFDataMapper.insertBatch(busYgDataList);
|
||||
|
||||
//更新分样子样
|
||||
// if(businessAssayTaskDataDOs.size() > 0) {
|
||||
// busSubCsampleService.updateBatchById(businessAssayTaskDataDOs);
|
||||
// }
|
||||
|
||||
//更新分析结果
|
||||
if (busElementValueList.size() > 0) {
|
||||
businessAssayProjectDataMapper.updateBatch(busElementValueList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return reqList.size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user