分析保存等修改

This commit is contained in:
2025-11-11 17:43:41 +08:00
parent 398fd2d303
commit 0c13b35433
28 changed files with 417 additions and 219 deletions

View File

@@ -29,6 +29,7 @@ import com.zt.plat.framework.excel.core.util.ExcelUtils;
import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO;
import com.zt.plat.module.qms.business.bus.service.BusinessSampleHandoverService;
import com.alibaba.fastjson2.JSONObject;
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
@@ -84,6 +85,14 @@ public class BusinessSampleHandoverController implements BusinessControllerMarke
return success(BeanUtils.toBean(businessSampleHandover, BusinessSampleHandoverRespVO.class));
}
@GetMapping("/reportDetail")
@Operation(summary = "除样品交接详情数据")
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
JSONObject jsonObject = businessSampleHandoverService.reportDetail(id);
return success(jsonObject);
}
@GetMapping("/page")
@Operation(summary = "获得样品交接单业务分页")
//@PreAuthorize("@ss.hasPermission('qms:business-sample-handover:query')")

View File

@@ -65,4 +65,13 @@ public class BatchSampleAnalysisColumnRespVO implements Serializable {
@Schema(description = "填写方式")
private String fillingWay;
@Schema(description = "参数分组_ID")
private Long groupDictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String groupDictionaryBusinessKey;
@Schema(description = "参数分组_Name")
private String groupDictionaryBusinessName;
}

View File

@@ -60,4 +60,13 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable {
@Schema(description = "填写方式")
private String fillingWay;
@Schema(description = "参数分组_ID")
private Long groupDictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String groupDictionaryBusinessKey;
@Schema(description = "参数分组_Name")
private String groupDictionaryBusinessName;
}

View File

@@ -26,4 +26,7 @@ public class BusinessAssayTaskDataExtendRespVO extends BusinessAssayTaskDataResp
@Schema(description = "分析编号")
private String sampleAssayCode;
@Schema(description = "任务单模板key")
private String configReportTemplateKey;
}

View File

@@ -12,6 +12,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAnd
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
@@ -27,6 +28,7 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
.selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
.selectAs(BusinessAssayParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
@@ -41,6 +43,9 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
.eqIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataId())
.eqIfPresent(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId())
.eqIfPresent(BusinessAssayParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())

View File

@@ -14,6 +14,7 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
@@ -29,6 +30,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayProjectDataDO>()
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId)
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
.selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
.selectAs(BusinessAssayProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
@@ -43,6 +45,9 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
.selectAs(ConfigAssayMethodProjectDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
.selectAs(ConfigAssayMethodProjectDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
.selectAs("'project'", BusinessAssayProjectAndParameterRespVO::getType)
.selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
.selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
.eqIfPresent(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, reqVO.getBusinessAssayTaskDataId())
.eqIfPresent(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
.eqIfPresent(BusinessAssayProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())

View File

@@ -117,6 +117,7 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
.selectAll(BusinessAssayTaskDataDO.class)
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
.selectAs(ConfigAssayMethodDO::getConfigReportTemplateKey, BusinessAssayTaskDataExtendRespVO::getConfigReportTemplateKey)
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)

View File

@@ -11,6 +11,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientPa
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
@@ -41,6 +42,7 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX<Bu
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCCoefficientParameterDataDO>()
.leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId)
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCCoefficientParameterDataDO::getDictionaryParameterId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId)
.selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
.selectAs(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
@@ -55,6 +57,9 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX<Bu
.selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
.selectAs(ConfigQCSampleMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
.eqIfPresent(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, reqVO.getBusinessQCCoefficientDataId())
.eqIfPresent(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, reqVO.getConfigQCSampleMethodParameterId())
.eqIfPresent(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())

View File

@@ -9,6 +9,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
@@ -39,6 +40,7 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX<Bus
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCManagementParameterDataDO>()
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId)
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCManagementParameterDataDO::getDictionaryParameterId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
.selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
.selectAs(BusinessQCManagementParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
@@ -53,6 +55,9 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX<Bus
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
.eqIfPresent(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, reqVO.getBusinessQCManagementProjectDataId())
.eqIfPresent(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId())
.eqIfPresent(BusinessQCManagementParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())

View File

@@ -9,6 +9,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
@@ -43,6 +44,7 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX<Busin
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCManagementProjectDataDO>()
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId)
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
.selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
.selectAs(BusinessQCManagementProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
@@ -57,6 +59,9 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX<Busin
.selectAs(ConfigAssayMethodProjectDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
.selectAs(ConfigAssayMethodProjectDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
.selectAs("'project'", BusinessAssayProjectAndParameterRespVO::getType)
.selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
.selectAs(ConfigAssayMethodProjectDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
.eqIfPresent(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, reqVO.getBusinessQCManagementDataId())
.eqIfPresent(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
.eqIfPresent(BusinessQCManagementProjectDataDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())

View File

@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleHandoverDetailPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
/**
@@ -31,5 +34,10 @@ public interface BusinessSampleHandoverDetailMapper extends BaseMapperX<Business
.eqIfPresent(BusinessSampleHandoverDetailDO::getRemark, reqVO.getRemark())
.orderByDesc(BusinessSampleHandoverDetailDO::getId));
}
default List<BusinessSampleHandoverDetailDO> selectByBusinessSampleHandoverId(Long businessSampleHandoverId) {
return selectList(new LambdaQueryWrapperX<BusinessSampleHandoverDetailDO>()
.eq(BusinessSampleHandoverDetailDO::getBusinessSampleHandoverId, businessSampleHandoverId));
}
}

View File

@@ -76,6 +76,7 @@ public class SampleSubHandoverCmp extends NodeComponent {
businessSampleHandoverDetailDO.setBusinessSampleHandoverId(businessSampleHandoverDO.getId());
businessSampleHandoverDetailDO.setBusinessSubSampleId(businessSubSample.getId());
businessSampleHandoverDetailDO.setSampleName(businessSubSample.getSampleName());
businessSampleHandoverDetailDO.setSampleCode(businessSubSample.getSampleReturnCode());
businessSampleHandoverDetailDO.setBalanceCode(businessSubSample.getLastBalanceCode());
businessSampleHandoverDetailDO.setSampleWeight(businessSubSample.getLastSampleWeight());
businessSampleHandoverDetailDO.setDictionaryBusinessId(businessSubSample.getDictionaryBusinessId());

View File

@@ -87,6 +87,10 @@ public class SampleTaskAssignQCSampleCmp extends NodeComponent {
//循环分配任务
for (BusinessAssayTaskDO businessAssayTaskDO : businessAssayTaskList) {
ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO = configQCSampleMethodList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDO.getConfigAssayMethodId()) && "kby".equals(f.getDictionaryBusinessKey())).findFirst().orElse(null);
//不存在空白样,直接跳出
if (configQCSampleMethodExtendRespVO == null) {
break;
}
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(businessAssayTaskDO.getConfigAssayMethodId());

View File

@@ -9,6 +9,7 @@ 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.BusinessSampleHandoverDO;
import com.alibaba.fastjson2.JSONObject;
import com.zt.plat.framework.common.pojo.PageParam;
/**
@@ -55,6 +56,13 @@ public interface BusinessSampleHandoverService {
*/
BusinessSampleHandoverDO getBusinessSampleHandover(Long id);
/**
* 获取样品交接单报表数据
* @param id
* @return
*/
JSONObject reportDetail(Long id);
/**
* 获得样品交接单业务分页
*
@@ -63,4 +71,5 @@ public interface BusinessSampleHandoverService {
*/
PageResult<BusinessSampleHandoverDO> getBusinessSampleHandoverPage(BusinessSampleHandoverPageReqVO pageReqVO);
}

View File

@@ -10,15 +10,18 @@ import org.springframework.validation.annotation.Validated;
import java.util.*;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONFactory;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
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.BusinessSampleHandoverDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverDetailMapper;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleHandoverMapper;
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.*;
/**
@@ -32,6 +35,9 @@ public class BusinessSampleHandoverServiceImpl implements BusinessSampleHandover
@Resource
private BusinessSampleHandoverMapper businessSampleHandoverMapper;
@Resource
private BusinessSampleHandoverDetailMapper businessSampleHandoverDetailMapper;
@Override
public BusinessSampleHandoverRespVO createBusinessSampleHandover(BusinessSampleHandoverSaveReqVO createReqVO) {
@@ -85,6 +91,26 @@ public class BusinessSampleHandoverServiceImpl implements BusinessSampleHandover
return businessSampleHandoverMapper.selectById(id);
}
@Override
public JSONObject reportDetail(Long id) {
JSONWriter.Context context = JSONFactory.createWriteContext();
context.setDateFormat("yyyy-MM-dd HH:mm:ss");
JSONObject result = new JSONObject();
BusinessSampleHandoverDO businessSampleHandover = businessSampleHandoverMapper.selectById(id);
String jsonString = JSON.toJSONString(businessSampleHandover, context);
JSONObject businessSampleHandoverJson = JSON.parseObject(jsonString);
JSONArray jsonArray = new JSONArray();
jsonArray.add(businessSampleHandoverJson);
List<BusinessSampleHandoverDetailDO> detailList = businessSampleHandoverDetailMapper.selectByBusinessSampleHandoverId(id);
String detailListJsonString = JSON.toJSONString(detailList, context);
result.put("main", jsonArray);
result.put("detail", JSON.parseArray(detailListJsonString));
return result;
}
@Override
public PageResult<BusinessSampleHandoverDO> getBusinessSampleHandoverPage(BusinessSampleHandoverPageReqVO pageReqVO) {
return businessSampleHandoverMapper.selectPage(pageReqVO);

View File

@@ -148,8 +148,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));
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null));
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("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
@@ -165,7 +165,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()));
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()));
if (StringUtils.isNotEmpty(ep.getFormula())) {
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
@@ -175,7 +175,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()));
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()));
}
}
}
@@ -404,8 +404,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));
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null));
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("cupNumber", "cupNumber", "杯号", "200px", "200px", "string", null, null, null, null, true, null));
@@ -420,7 +420,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()));
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()));
if (StringUtils.isNotEmpty(ep.getFormula())) {
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
@@ -430,7 +430,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()));
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()));
}
}
}
@@ -490,8 +490,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));
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", "200px", "200px", "string", null, null, null, null, false, null, null));
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));
//处理数据
List<Map<String, Object>> datas = new ArrayList<>();
@@ -509,7 +509,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()));
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()));
}
@@ -549,7 +549,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()));
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()));
if (StringUtils.isNotEmpty(ep.getFormula())) {
BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO();
@@ -559,7 +559,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()));
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()));
}
}
}
@@ -618,223 +618,233 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
}
List<BusinessAssayTaskAnalysisDataRespVO> assayTaskAnalysisDataList = vo.getAssayTaskAnalysisDataList();
for (BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO : assayTaskAnalysisDataList) {
if ("analysis".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessAssayProjectDataDO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessAssayParameterDataDO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayParameterDataDO>().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList));
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("project".equals(pap.getType())) {
BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessAssayProjectDataDO.setValue(pap.getValue());
businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessAssayProjectDataDO.setValue(value.toPlainString());
businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessAssayProjectDataDO.setValue(null);
if (CollUtil.isNotEmpty(assayTaskAnalysisDataList)) {
for (BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO : assayTaskAnalysisDataList) {
if ("analysis".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, vo.getBusinessAssayTaskId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessAssayProjectDataDO> businessAssayProjectDataList = businessAssayProjectDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayProjectDataDO>().in(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataIdList));
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessAssayParameterDataDO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayParameterDataDO>().in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIdList));
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
} else if ("parameter".equals(pap.getType())) {
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessAssayParameterDataDO.setValue(pap.getValue());
businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessAssayParameterDataDO.setValue(value.toPlainString());
businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("project".equals(pap.getType())) {
BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessAssayProjectDataDO.setValue(pap.getValue());
businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessAssayProjectDataDO.setValue(value.toPlainString());
businessAssayProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessAssayProjectDataDO.setValue(null);
}
} else if ("parameter".equals(pap.getType())) {
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessAssayParameterDataDO.setValue(pap.getValue());
businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessAssayParameterDataDO.setValue(value.toPlainString());
businessAssayParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessAssayParameterDataDO.setValue(null);
}
} else {
businessAssayParameterDataDO.setValue(null);
}
}
}
}
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
if (CollUtil.isNotEmpty(businessAssayParameterDataList)) {
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
}
} else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
List<BusinessQCManagementDataDO> BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
List<Long> businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(businessQCManagementDataIdList);
List<Long> businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCManagementParameterDataDO> businessQCManagementParameterDataList = businessQCManagementParameterDataMapper.selectByBusinessQCManagementProjectDataIds(businessQCManagementProjectDataIdList);
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
if (CollUtil.isNotEmpty(businessAssayProjectDataList)) {
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("project".equals(pap.getType())) {
BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = businessQCManagementProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCManagementProjectDataDO.setValue(pap.getValue());
businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCManagementProjectDataDO.setValue(value.toPlainString());
businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessQCManagementProjectDataDO.setValue(null);
if (CollUtil.isNotEmpty(businessAssayParameterDataList)) {
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
}
} else if ("zky".equals(businessAssayTaskAnalysisDataRespVO.getAnalysisType())) {
List<BusinessQCManagementDataDO> BusinessQCManagementDataList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
List<Long> businessQCManagementDataIdList = BusinessQCManagementDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCManagementProjectDataDO> businessQCManagementProjectDataList = businessQCManagementProjectDataMapper.selectByBusinessQCManagementDataIds(businessQCManagementDataIdList);
List<Long> businessQCManagementProjectDataIdList = businessQCManagementProjectDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCManagementParameterDataDO> businessQCManagementParameterDataList = businessQCManagementParameterDataMapper.selectByBusinessQCManagementProjectDataIds(businessQCManagementProjectDataIdList);
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
} else if ("parameter".equals(pap.getType())) {
BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = businessQCManagementParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCManagementParameterDataDO.setValue(pap.getValue());
businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCManagementParameterDataDO.setValue(value.toPlainString());
businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("project".equals(pap.getType())) {
BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = businessQCManagementProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCManagementProjectDataDO.setValue(pap.getValue());
businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCManagementProjectDataDO.setValue(value.toPlainString());
businessQCManagementProjectDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessQCManagementProjectDataDO.setValue(null);
}
} else if ("parameter".equals(pap.getType())) {
BusinessQCManagementParameterDataDO businessQCManagementParameterDataDO = businessQCManagementParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCManagementParameterDataDO.setValue(pap.getValue());
businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCManagementParameterDataDO.setValue(value.toPlainString());
businessQCManagementParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessQCManagementParameterDataDO.setValue(null);
}
} else {
businessQCManagementParameterDataDO.setValue(null);
}
}
}
if (CollUtil.isNotEmpty(businessQCManagementProjectDataList)) {
businessQCManagementProjectDataMapper.updateBatch(businessQCManagementProjectDataList);
}
if (CollUtil.isNotEmpty(businessQCManagementParameterDataList)) {
businessQCManagementParameterDataMapper.updateBatch(businessQCManagementParameterDataList);
}
} else {
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
List<Long> businessQCCoefficientDataIdList = businessQCCoefficientDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList = businessQCCoefficientParameterDataMapper.selectByBusinessQCCoefficientDataIds(businessQCCoefficientDataIdList);
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("parameter".equals(pap.getType())) {
BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = businessQCCoefficientParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCCoefficientParameterDataDO.setValue(pap.getValue());
businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCCoefficientParameterDataDO.setValue(value.toPlainString());
businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessQCCoefficientParameterDataDO.setValue(null);
}
}
}
}
}
businessQCManagementProjectDataMapper.updateBatch(businessQCManagementProjectDataList);
if (CollUtil.isNotEmpty(businessQCManagementParameterDataList)) {
businessQCManagementParameterDataMapper.updateBatch(businessQCManagementParameterDataList);
}
} else {
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
List<Long> businessQCCoefficientDataIdList = businessQCCoefficientDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessQCCoefficientParameterDataDO> businessQCCoefficientParameterDataList = businessQCCoefficientParameterDataMapper.selectByBusinessQCCoefficientDataIds(businessQCCoefficientDataIdList);
List<Map<String,Object>> datas = businessAssayTaskAnalysisDataRespVO.getDatas();
for (Map<String, Object> map : datas) {
List<BusinessAssayProjectAndParameterRespVO> listBusinessAssayProjectAndParameter = new ArrayList<>();
for (Map.Entry<String, Object> entry : map.entrySet()) {
Object val = entry.getValue();
if (val instanceof String || val == null) {
continue;
}
BusinessAssayProjectAndParameterRespVO businessAssayProjectAndParameter = JSON.parseObject(JSON.toJSONString(val), BusinessAssayProjectAndParameterRespVO.class);
listBusinessAssayProjectAndParameter.add(businessAssayProjectAndParameter);
if (CollUtil.isNotEmpty(businessQCCoefficientParameterDataList)) {
businessQCCoefficientParameterDataMapper.updateBatch(businessQCCoefficientParameterDataList);
}
for (BusinessAssayProjectAndParameterRespVO pap : listBusinessAssayProjectAndParameter) {
if ("parameter".equals(pap.getType())) {
BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = businessQCCoefficientParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
if (StringUtils.isNotBlank(pap.getValue())) {
String dataType = pap.getDataType();//string-字符串int-整数decimal-小数,date-日期datetime-时间
switch (dataType) {
case "int":
case "date":
case "datetime":
case "string":
businessQCCoefficientParameterDataDO.setValue(pap.getValue());
businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + pap.getValue());
break;
case "decimal":
BigDecimal value = new BigDecimal(pap.getValue());
value = value.setScale(pap.getDecimalPosition(), RoundingMode.HALF_EVEN);
businessQCCoefficientParameterDataDO.setValue(value.toPlainString());
businessQCCoefficientParameterDataDO.setRemark(pap.getShowName() + ": " + value.toPlainString());
break;
default:
throw new IllegalArgumentException("Unexpected value: " + dataType);
}
} else {
businessQCCoefficientParameterDataDO.setValue(null);
}
}
}
}
businessQCCoefficientParameterDataMapper.updateBatch(businessQCCoefficientParameterDataList);
}
}
businessAssayTaskMapper.updateById(businessAssayTaskDO);
}

View File

@@ -46,6 +46,12 @@ public class ConfigAssayMethodProjectPageReqVO extends PageParam {
@Schema(description = "方法检出下限值")
private String minimumLimitValue;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "排序号")
private Integer sortNo;

View File

@@ -40,6 +40,12 @@ public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam {
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "所属部门")
private String systemDepartmentCode;

View File

@@ -52,6 +52,12 @@ public class ConfigAssayMethodProjectParameterRespVO {
@ExcelProperty("排序号")
private Integer sortNo;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "所属部门")
@ExcelProperty("所属部门")
private String systemDepartmentCode;

View File

@@ -44,6 +44,12 @@ public class ConfigAssayMethodProjectParameterSaveReqVO {
@Schema(description = "排序号")
private Integer sortNo;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "所属部门")
private String systemDepartmentCode;

View File

@@ -59,6 +59,12 @@ public class ConfigAssayMethodProjectRespVO {
@Schema(description = "方法检出下限值")
private String minimumLimitValue;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "排序号")
@ExcelProperty("排序号")
private Integer sortNo;

View File

@@ -50,6 +50,12 @@ public class ConfigAssayMethodProjectSaveReqVO {
@Schema(description = "方法检出下限值")
private String minimumLimitValue;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "排序号")
private Integer sortNo;

View File

@@ -34,6 +34,12 @@ public class ConfigQCSampleMethodParameterPageReqVO extends PageParam {
@Schema(description = "计算公式")
private String formula;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "pc界面是否显示")
private Integer isShow;

View File

@@ -44,6 +44,12 @@ public class ConfigQCSampleMethodParameterRespVO {
@ExcelProperty("计算公式")
private String formula;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "pc界面是否显示", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("pc界面是否显示")
private Integer isShow;

View File

@@ -41,6 +41,12 @@ public class ConfigQCSampleMethodParameterSaveReqVO {
@NotNull(message = "pc界面是否显示不能为空")
private Integer isShow;
@Schema(description = "参数分组_ID")
private Long dictionaryBusinessId;
@Schema(description = "参数分组_Key")
private String dictionaryBusinessKey;
@Schema(description = "排序号")
private Integer sortNo;

View File

@@ -87,6 +87,16 @@ public class ConfigAssayMethodProjectDO extends BusinessBaseDO {
@TableField("MIN_LIM_VAL")
private String minimumLimitValue;
/**
* 参数分组_ID
*/
@TableField("DIC_BSN_ID")
private Long dictionaryBusinessId;
/**
* 参数分组_Key
*/
@TableField("DIC_BSN_KY")
private String dictionaryBusinessKey;
/**
* 排序号
*/
@TableField("SRT_NO")

View File

@@ -77,6 +77,16 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO {
@TableField("SRT_NO")
private Integer sortNo;
/**
* 参数分组_ID
*/
@TableField("DIC_BSN_ID")
private Long dictionaryBusinessId;
/**
* 参数分组_Key
*/
@TableField("DIC_BSN_KY")
private String dictionaryBusinessKey;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")

View File

@@ -77,6 +77,16 @@ public class ConfigQCSampleMethodParameterDO extends BusinessBaseDO {
@TableField("SRT_NO")
private Integer sortNo;
/**
* 参数分组_ID
*/
@TableField("DIC_BSN_ID")
private Long dictionaryBusinessId;
/**
* 参数分组_Key
*/
@TableField("DIC_BSN_KY")
private String dictionaryBusinessKey;
/**
* 所属部门
*/
@TableField("SYS_DEPT_CD")