报表计算等处理
This commit is contained in:
@@ -44,4 +44,7 @@ public class BusinessAssayParameterDataReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//===================扩展字段====================
|
||||
@Schema(description = "检测项目业务ID列表")
|
||||
private List<Long> businessAssayProjectDataIdList;
|
||||
}
|
||||
@@ -16,6 +16,9 @@ public class BusinessAssayProjectAndParameterRespVO implements Serializable {
|
||||
/** id主键 **/
|
||||
private Long id;
|
||||
|
||||
/** 业务数据id 如:T_BSN_ASY_PRJ_DAT表,则为BSN_ASY_TSK_DAT_ID,T_BSN_ASY_PRM_DAT表,则为BSN_ASY_PRJ_DAT_ID **/
|
||||
private Long bizId;
|
||||
|
||||
/** 元素或参数字典id **/
|
||||
private Long dicId;
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
@@ -49,6 +50,7 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||
.selectAs(DictionaryBusinessDO::getName, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessName)
|
||||
.eqIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataId())
|
||||
.inIfPresent(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, reqVO.getBusinessAssayProjectDataIdList())
|
||||
.eqIfPresent(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, reqVO.getConfigAssayMethodProjectParameterId())
|
||||
.eqIfPresent(BusinessAssayParameterDataDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())
|
||||
.eqIfPresent(BusinessAssayParameterDataDO::getValue, reqVO.getValue())
|
||||
|
||||
@@ -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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO;
|
||||
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.BusinessSubSampleDO;
|
||||
@@ -31,6 +32,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
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.BusinessAssayTaskParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
@@ -39,6 +40,7 @@ public interface BusinessAssayTaskParameterDataMapper extends BaseMapperX<Busine
|
||||
.leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getBusinessAssayTaskDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessAssayTaskParameterDataDO::getConfigAssayMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
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.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
@@ -42,6 +43,7 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX<Bu
|
||||
.leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getBusinessQCCoefficientDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -97,6 +97,12 @@ public interface BusinessQCManagementDataMapper extends BaseMapperX<BusinessQCMa
|
||||
return selectList(new LambdaQueryWrapperX<BusinessQCManagementDataDO>()
|
||||
.eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
}
|
||||
|
||||
default List<BusinessQCManagementDataDO> selectByBusinessAssayTaskIdAndDictionaryBusinessKey(Long businessAssayTaskId, String configAssayMethodDictionaryBusinessKey) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessQCManagementDataDO>()
|
||||
.eq(BusinessQCManagementDataDO::getBusinessAssayTaskId, businessAssayTaskId)
|
||||
.eq(BusinessQCManagementDataDO::getDictionaryBusinessKey, configAssayMethodDictionaryBusinessKey));
|
||||
}
|
||||
|
||||
default List<BusinessQCManagementDataDO> selectBySampleAssayCodesAndConfigAssayMethodDictionaryBusinessKey(List<String> sampleCodeList, String configAssayMethodDictionaryBusinessKey){
|
||||
return selectJoinList(BusinessQCManagementDataDO.class, new MPJLambdaWrapperX<BusinessQCManagementDataDO>()
|
||||
|
||||
@@ -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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
|
||||
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;
|
||||
@@ -41,6 +42,7 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX<Bus
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getBusinessQCManagementProjectDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
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;
|
||||
@@ -46,6 +47,7 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX<Busin
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getBusinessQCManagementDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -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.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementSampleParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
@@ -39,6 +40,7 @@ public interface BusinessQCManagementSampleParameterDataMapper extends BaseMappe
|
||||
.leftJoin(ConfigAssayMethodParameterDO.class, ConfigAssayMethodParameterDO::getId, BusinessQCManagementSampleParameterDataDO::getConfigAssayMethodParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCManagementSampleParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCManagementSampleParameterDataDO::getBusinessQCManagementDataId, BusinessAssayProjectAndParameterRespVO::getBizId)
|
||||
.selectAs(BusinessQCManagementSampleParameterDataDO::getConfigAssayMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -354,13 +354,21 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
||||
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) {
|
||||
map.put(ep.getName(), ep.getValue());
|
||||
String ev = ep.getValue();
|
||||
if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) {
|
||||
ev = ep.getSymbol() + ev;
|
||||
}
|
||||
map.put(ep.getName(), ev);
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
map.put(p.getName(), p.getValue());
|
||||
String v = p.getValue();
|
||||
if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) {
|
||||
v = p.getSymbol() + v;
|
||||
}
|
||||
map.put(p.getName(), v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,13 +401,21 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
projectDataSearch2.setBusinessQCManagementDataId(businessQCManagementData.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessQCManagementProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
||||
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) {
|
||||
map.put(ep.getName(), ep.getValue());
|
||||
String ev = ep.getValue();
|
||||
if (StringUtils.isNotBlank(ep.getSymbol()) && !"=".equals(ep.getSymbol())) {
|
||||
ev = ep.getSymbol() + ev;
|
||||
}
|
||||
map.put(ep.getName(), ev);
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
map.put(p.getName(), p.getValue());
|
||||
String v = p.getValue();
|
||||
if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) {
|
||||
v = p.getSymbol() + v;
|
||||
}
|
||||
map.put(p.getName(), v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,7 +441,11 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist2) {
|
||||
map.put(p.getName(), p.getValue());
|
||||
String v = p.getValue();
|
||||
if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) {
|
||||
v = p.getSymbol() + v;
|
||||
}
|
||||
map.put(p.getName(), v);
|
||||
}
|
||||
datas.add(map);
|
||||
}
|
||||
@@ -462,12 +482,17 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
// newMap.put(ep.getName(), ep.getValue());
|
||||
newMap.put("projectName", ep.getName());
|
||||
newMap.put("projectValue", ep.getValue());
|
||||
newMap.put("projectSymbol", ep.getSymbol());
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
newMap.put(p.getName(), p.getValue());
|
||||
String v = p.getValue();
|
||||
if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) {
|
||||
v = p.getSymbol() + v;
|
||||
}
|
||||
newMap.put(p.getName(), v);
|
||||
}
|
||||
}
|
||||
datas.add(newMap);
|
||||
@@ -492,7 +517,11 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
List<BusinessAssayProjectAndParameterRespVO> businessQCManagementSampleParameterDataList = businessQCManagementSampleParameterDataMapper.selectByBusinessQCManagementDataIds(Arrays.asList(businessQCManagementData.getId()));
|
||||
for (BusinessAssayProjectAndParameterRespVO businessQCManagementSampleParameterData : businessQCManagementSampleParameterDataList) {
|
||||
map.put(businessQCManagementSampleParameterData.getName(), businessQCManagementSampleParameterData.getValue());
|
||||
String v = businessQCManagementSampleParameterData.getValue();
|
||||
if (StringUtils.isNotBlank(businessQCManagementSampleParameterData.getSymbol()) && !"=".equals(businessQCManagementSampleParameterData.getSymbol())) {
|
||||
v = businessQCManagementSampleParameterData.getSymbol() + v;
|
||||
}
|
||||
map.put(businessQCManagementSampleParameterData.getName(), v);
|
||||
}
|
||||
|
||||
BusinessQCManagementProjectDataReqVO projectDataSearch2 = new BusinessQCManagementProjectDataReqVO();
|
||||
@@ -503,12 +532,17 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
// newMap.put(ep.getName(), ep.getValue());
|
||||
newMap.put("projectName", ep.getName());
|
||||
newMap.put("projectValue", ep.getValue());
|
||||
newMap.put("projectSymbol", ep.getSymbol());
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessQCManagementParameterDataReqVO parameterDataSearch = new BusinessQCManagementParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessQCManagementProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessQCManagementParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
newMap.put(p.getName(), p.getValue());
|
||||
String v = p.getValue();
|
||||
if (StringUtils.isNotBlank(p.getSymbol()) && !"=".equals(p.getSymbol())) {
|
||||
v = p.getSymbol() + v;
|
||||
}
|
||||
newMap.put(p.getName(), v);
|
||||
}
|
||||
}
|
||||
datas.add(newMap);
|
||||
@@ -517,7 +551,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
List<BusinessQCCoefficientDataDO> businessQCCoefficientDataDOList = businessQCCoefficientDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||
for (BusinessQCCoefficientDataDO businessQCCoefficientData: businessQCCoefficientDataDOList) {
|
||||
Map<String, Object> map = new HashedMap<>();
|
||||
HashedMap<String, Object> map = new HashedMap<>();
|
||||
map.put("businessAssayTaskDataId", businessQCCoefficientData.getId());
|
||||
map.put("businessAssayTaskId", businessQCCoefficientData.getBusinessAssayTaskId());
|
||||
map.put("businessSubSampleId", "");
|
||||
@@ -533,9 +567,13 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
parameterDataSearch2.setBusinessQCCoefficientDataId(businessQCCoefficientData.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist2 = businessQCCoefficientParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch2);
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist2) {
|
||||
map.put(p.getName(), p.getValue());
|
||||
//map.put(p.getName(), p.getValue());
|
||||
HashedMap<String, Object> newMap = SerializationUtils.clone(map);
|
||||
newMap.put("projectName", p.getName());
|
||||
newMap.put("projectValue", p.getValue());
|
||||
newMap.put("projectSymbol", p.getSymbol());
|
||||
datas.add(map);
|
||||
}
|
||||
datas.add(map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -922,6 +960,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
businessSubParentSampleAssessmentProjectDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
businessSubParentSampleAssessmentProjectDO.setAssessmentStatus(QmsCommonConstant.NORMAL);
|
||||
businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue());
|
||||
businessSubParentSampleAssessmentProjectDO.setSymbol(businessSubSampleAssessment.getSymbol());
|
||||
businessSubParentSampleAssessmentProjectDO.setTaskType(businessSubSampleAssessment.getTaskType());
|
||||
businessSubParentSampleAssessmentProjectDO.setAssayType(businessSubSampleAssessment.getAssayType());
|
||||
businessSubParentSampleAssessmentProjectDO.setDataType(businessSubSampleAssessment.getDataType());
|
||||
@@ -1115,6 +1154,14 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
})
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//符号处理
|
||||
String symbol = "=";
|
||||
BusinessAssayProjectDataDO noEquals = businessAssayProjectDataDOList.stream().filter(f -> !"=".equals(f.getSymbol())).findFirst().orElse(null);
|
||||
if (noEquals != null) {
|
||||
symbol = noEquals.getSymbol();
|
||||
}
|
||||
businessSubSampleAssessmentProjectDO.setSymbol(symbol);
|
||||
|
||||
// 获取小数精度
|
||||
int elementScale = businessSubSampleAssessmentProjectDO.getDecimalPosition();
|
||||
|
||||
@@ -196,10 +196,12 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
businessAssayTaskAnalysisSampleProjectRespVO.setConfigAssayMethodName(configAssayMethodDO.getName());
|
||||
businessAssayTaskAnalysisSampleProjectRespVO.setDataCollectionKey(configAssayMethodDO.getDataCollectionKey());
|
||||
|
||||
String minWidth = "200px";
|
||||
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
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("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
|
||||
|
||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||
@@ -233,7 +235,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(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, 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();
|
||||
@@ -243,7 +245,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(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -555,12 +557,13 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
businessAssayTaskAnalysisDataRespVO.setAnalysisType("analysis");
|
||||
businessAssayTaskAnalysisDataRespVO.setAnalysisName("分析样");
|
||||
businessAssayTaskAnalysisDataRespVO.setSortNo(99);
|
||||
|
||||
|
||||
String minWidth = "200px";
|
||||
|
||||
//处理列
|
||||
List<BatchSampleAnalysisColumnRespVO> cloumns = new ArrayList<>();
|
||||
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("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
|
||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||
@@ -590,12 +593,20 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
String fieldIndex = "a" + taskParameter.getDicId();
|
||||
String title = taskParameter.getShowName() + (StringUtils.isBlank(taskParameter.getUnit()) ? "" : "(" + taskParameter.getUnit() + ")");
|
||||
boolean isEdit = StringUtils.isBlank(taskParameter.getFormula());
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
|
||||
//查询检测项目
|
||||
BusinessAssayProjectDataReqVO projectDataSearch = new BusinessAssayProjectDataReqVO();
|
||||
projectDataSearch.setBusinessAssayTaskDataIdList(businessAssayTaskDataIdList);
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch);
|
||||
List<Long> businessAssayProjectDataIdList = projectAndParameterList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
//检测项目参数
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessAssayProjectDataIdList(businessAssayProjectDataIdList);
|
||||
List<BusinessAssayProjectAndParameterRespVO> businessAssayParameterDataList = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
|
||||
Map<Long, List<BusinessAssayProjectAndParameterRespVO>> projectAndParameterMap = projectAndParameterList.stream().sorted(Comparator.comparing(BusinessAssayProjectAndParameterRespVO::getParamNo)).collect(Collectors.groupingBy(BusinessAssayProjectAndParameterRespVO::getDicId,
|
||||
LinkedHashMap::new, // 保持组首次出现的顺序(可选)
|
||||
Collectors.toList() // ArrayList 保持组内顺序
|
||||
@@ -605,17 +616,21 @@ 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(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
if (isEdit) {
|
||||
minWidth = "280px";
|
||||
}
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, 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();
|
||||
parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
//BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
//parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
//List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(ep.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
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(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -729,20 +744,23 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
map.put("rollbackStatus", businessAssayTaskDetailDO.getRollbackStatus());
|
||||
|
||||
|
||||
List<BusinessAssayProjectAndParameterRespVO> taskParameterList2 = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId()));
|
||||
//List<BusinessAssayProjectAndParameterRespVO> taskParameterList2 = businessAssayTaskParameterDataMapper.selectByBusinessAssayTaskDataIds(Arrays.asList(businessAssayTaskDataDO.getId()));
|
||||
List<BusinessAssayProjectAndParameterRespVO> taskParameterList2 = taskParameterList.stream().filter(f -> f.getBizId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayProjectAndParameterRespVO taskParameter : taskParameterList2) {
|
||||
map.put("a" + taskParameter.getDicId(), taskParameter);
|
||||
}
|
||||
|
||||
BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
||||
projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
||||
//BusinessAssayProjectDataReqVO projectDataSearch2 = new BusinessAssayProjectDataReqVO();
|
||||
//projectDataSearch2.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||
//List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = businessAssayProjectDataMapper.selectProjectAndParameterBy(projectDataSearch2);
|
||||
List<BusinessAssayProjectAndParameterRespVO> projectAndParameterList2 = projectAndParameterList.stream().filter(f -> f.getBizId().equals(businessAssayTaskDataDO.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayProjectAndParameterRespVO ep : projectAndParameterList2) {
|
||||
map.put("e" + ep.getDicId(), ep);
|
||||
if (StringUtils.isNotEmpty(ep.getFormula())) {
|
||||
BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
//BusinessAssayParameterDataReqVO parameterDataSearch = new BusinessAssayParameterDataReqVO();
|
||||
//parameterDataSearch.setBusinessAssayProjectDataId(ep.getId());
|
||||
//List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataMapper.selectProjectAndParameterBy(parameterDataSearch);
|
||||
List<BusinessAssayProjectAndParameterRespVO> plist = businessAssayParameterDataList.stream().filter(f -> f.getBizId().equals(ep.getId())).collect(Collectors.toList());
|
||||
for (BusinessAssayProjectAndParameterRespVO p : plist) {
|
||||
map.put("p" + p.getDicId(), p);
|
||||
}
|
||||
@@ -760,7 +778,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
private List<BusinessAssayTaskAnalysisDataRespVO> getQcAnalysis(BusinessAssayTaskDO businessAssayTaskDO) {
|
||||
List<BusinessAssayTaskAnalysisDataRespVO> list = new ArrayList<>();
|
||||
|
||||
|
||||
String minWidth = "200px";
|
||||
List<ConfigQCSampleMethodExtendRespVO> configQCSampleMethodList = configQCSampleMethodMapper.selectByConfigAssayMethodId(businessAssayTaskDO.getConfigAssayMethodId());
|
||||
BusinessAssayTaskAnalysisDataRespVO businessAssayTaskAnalysisDataRespVO = null;
|
||||
for (ConfigQCSampleMethodExtendRespVO configQCSampleMethodExtendRespVO : configQCSampleMethodList) {
|
||||
@@ -772,8 +791,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, 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("sampleCode", "sampleCode", "样品编号", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO("sampleName", "sampleName", "样品名称", minWidth, minWidth, "string", null, null, null, null, false, null, null, null, null, null, null));
|
||||
|
||||
//处理数据
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
@@ -791,7 +810,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(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
|
||||
|
||||
@@ -814,10 +833,8 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
datas.add(map);
|
||||
}
|
||||
|
||||
|
||||
} else {//带检测项目
|
||||
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskId(businessAssayTaskDO.getId());
|
||||
List<BusinessQCManagementDataDO> businessQCManagementDataDOList = businessQCManagementDataMapper.selectByBusinessAssayTaskIdAndDictionaryBusinessKey(businessAssayTaskDO.getId(), configQCSampleMethodExtendRespVO.getDictionaryBusinessKey());
|
||||
|
||||
if (CollUtil.isEmpty(businessQCManagementDataDOList)) {
|
||||
break;
|
||||
@@ -836,7 +853,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
String fieldIndex = "a" + taskParameter.getDicId();
|
||||
String title = taskParameter.getShowName() + (StringUtils.isBlank(taskParameter.getUnit()) ? "" : "(" + taskParameter.getUnit() + ")");
|
||||
boolean isEdit = StringUtils.isBlank(taskParameter.getFormula());
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", "120px", taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName()));
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, taskParameter.getDataType(), taskParameter.getDecimalPosition(), null, taskParameter.getFormula(), taskParameter.getParamNo(), isEdit, taskParameter.getUnit(), "attribute", taskParameter.getFillingWay(), taskParameter.getGroupDictionaryBusinessId(), taskParameter.getGroupDictionaryBusinessKey(), taskParameter.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
|
||||
|
||||
@@ -847,7 +864,14 @@ 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(), "project", ep.getFillingWay(), ep.getGroupDictionaryBusinessId(), ep.getGroupDictionaryBusinessKey(), ep.getGroupDictionaryBusinessName()));
|
||||
if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) && StringUtils.isNotBlank(ep.getFormula()) && ep.getFormula().startsWith("From")) {
|
||||
isEdit = true;
|
||||
ep.setFormula(null);
|
||||
}
|
||||
if (isEdit) {
|
||||
minWidth = "280px";
|
||||
}
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, 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();
|
||||
@@ -857,7 +881,11 @@ 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(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
if ("zkkby".equals(configQCSampleMethodExtendRespVO.getDictionaryBusinessKey()) && StringUtils.isNotBlank(p.getFormula()) && p.getFormula().startsWith("From")) {
|
||||
isEdit = true;
|
||||
p.setFormula(null);
|
||||
}
|
||||
cloumns.add(new BatchSampleAnalysisColumnRespVO(fieldIndex, fieldIndex + ".value", title, "", minWidth, p.getDataType(), p.getDecimalPosition(), null, p.getFormula(), p.getParamNo(), isEdit, p.getUnit(), "parameter", p.getFillingWay(), p.getGroupDictionaryBusinessId(), p.getGroupDictionaryBusinessKey(), p.getGroupDictionaryBusinessName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -958,6 +986,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
if ("project".equals(pap.getType())) {
|
||||
BusinessAssayProjectDataDO businessAssayProjectDataDO = businessAssayProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
|
||||
if (StringUtils.isNotBlank(pap.getValue())) {
|
||||
businessAssayProjectDataDO.setSymbol(pap.getSymbol());
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
@@ -982,6 +1011,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
} 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())) {
|
||||
businessAssayParameterDataDO.setSymbol(pap.getSymbol());
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
@@ -1072,6 +1102,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
if ("project".equals(pap.getType())) {
|
||||
BusinessQCManagementProjectDataDO businessQCManagementProjectDataDO = businessQCManagementProjectDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
|
||||
if (StringUtils.isNotBlank(pap.getValue())) {
|
||||
businessQCManagementProjectDataDO.setSymbol(pap.getSymbol());
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
@@ -1096,6 +1127,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
} 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())) {
|
||||
businessQCManagementParameterDataDO.setSymbol(pap.getSymbol());
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
@@ -1181,6 +1213,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
if ("parameter".equals(pap.getType())) {
|
||||
BusinessQCCoefficientParameterDataDO businessQCCoefficientParameterDataDO = businessQCCoefficientParameterDataList.stream().filter(f -> f.getId().equals(pap.getId())).findFirst().orElse(null);
|
||||
if (StringUtils.isNotBlank(pap.getValue())) {
|
||||
businessQCCoefficientParameterDataDO.setSymbol(pap.getSymbol());
|
||||
String dataType = pap.getDataType();//string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
switch (dataType) {
|
||||
case "int":
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -16,6 +17,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.qlexpress4.Express4Runner;
|
||||
import com.alibaba.qlexpress4.QLOptions;
|
||||
import com.alibaba.qlexpress4.QLResult;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
@@ -175,7 +179,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果");
|
||||
StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder();
|
||||
for (BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) {
|
||||
noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), businessSubParentSampleAssessmentDO.getAssessmentValue());
|
||||
String assessmentValue = businessSubParentSampleAssessmentDO.getAssessmentValue();
|
||||
if (StringUtils.isNotBlank(businessSubParentSampleAssessmentDO.getSymbol()) && !"=".equals(businessSubParentSampleAssessmentDO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号
|
||||
assessmentValue = businessSubParentSampleAssessmentDO.getSymbol() + assessmentValue;
|
||||
}
|
||||
noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), assessmentValue);
|
||||
businessSubParentSampleAssessmentIds.append(businessSubParentSampleAssessmentDO.getId()).append(",");
|
||||
}
|
||||
businessSubParentSampleAssessmentIds.delete(businessSubParentSampleAssessmentIds.length() -1, businessSubParentSampleAssessmentIds.length());
|
||||
@@ -191,7 +199,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentExtendBeforeList) {
|
||||
subSampleAssessmentBeforeMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime());
|
||||
subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
||||
subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
||||
String assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue();
|
||||
if (StringUtils.isNotBlank(businessSubSampleAssessmentProjectExtendRespVO.getSymbol()) && !"=".equals(businessSubSampleAssessmentProjectExtendRespVO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号
|
||||
assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getSymbol() + assessmentValue;
|
||||
}
|
||||
subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), assessmentValue);
|
||||
businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
||||
}
|
||||
businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length());
|
||||
@@ -207,7 +219,11 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
for (BusinessSubSampleAssessmentProjectExtendRespVO businessSubSampleAssessmentProjectExtendRespVO : businessSubSampleAssessmentList) {
|
||||
subSampleAssessmentMap.put("sampleReceiveTime", noReportSubParentSampleAssessmentRespVO.getSampleReceiveTime());
|
||||
subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentProjectExtendRespVO.getConfigAssayMethodName());
|
||||
subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue());
|
||||
String assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getAssessmentValue();
|
||||
if (StringUtils.isNotBlank(businessSubSampleAssessmentProjectExtendRespVO.getSymbol()) && !"=".equals(businessSubSampleAssessmentProjectExtendRespVO.getSymbol())) {//符号不为空,并且不为等于号。结果添加上符号
|
||||
assessmentValue = businessSubSampleAssessmentProjectExtendRespVO.getSymbol() + assessmentValue;
|
||||
}
|
||||
subSampleAssessmentMap.put(businessSubSampleAssessmentProjectExtendRespVO.getSimpleName(), assessmentValue);
|
||||
businessSubSampleAssessmentIds.append(businessSubSampleAssessmentProjectExtendRespVO.getId()).append(",");
|
||||
}
|
||||
businessSubSampleAssessmentIds.delete(businessSubSampleAssessmentIds.length() -1, businessSubSampleAssessmentIds.length());
|
||||
@@ -410,6 +426,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
businessSubSampleParentRecheckMapper.insertBatch(newBusinessSubSampleParentRecheckDOList);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private Express4Runner express4Runner;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayReportDataMapper businessAssayReportDataMapper;
|
||||
@@ -517,7 +536,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue());
|
||||
reportFieldValueData.setDataType(configReportField.getDataType());
|
||||
reportFieldValueData.setDecimalPosition(configReportField.getDecimalPosition());
|
||||
reportFieldValueData.setMathSymbol("=");
|
||||
reportFieldValueData.setMathSymbol(businessSubParentSampleAssessment.getSymbol());
|
||||
reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit());
|
||||
reportFieldValueData.setUsage(businessSubParentSampleAssessment.getUsage());
|
||||
reportFieldValueData.setMinLimitValue(businessSubParentSampleAssessment.getMinimumLimitValue());
|
||||
@@ -525,7 +544,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
assayDataJson.put(configReportField.getField(), reportFieldValueData);
|
||||
}
|
||||
}
|
||||
businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString());
|
||||
|
||||
//修改已上报数据来源
|
||||
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||
@@ -542,10 +560,66 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) {
|
||||
businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES);
|
||||
}
|
||||
if (busDataSources.size() > 0) {
|
||||
//计算
|
||||
// TODO
|
||||
if (busDataSources.size() > 0) {//计算
|
||||
|
||||
Map<String, Object> calcContext = assayDataJson.entrySet().stream().collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> {
|
||||
ReportFieldValueData data = (ReportFieldValueData) entry.getValue();
|
||||
String fieldValue = data != null ? data.getFieldValue() : null;
|
||||
if (fieldValue == null || fieldValue.isEmpty()) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return new BigDecimal(fieldValue);
|
||||
}
|
||||
));
|
||||
|
||||
//计算报表字段
|
||||
List<ConfigReportFieldDO> configReportFieldCalculatedList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_CALCULATED.equals(f.getFieldType())).collect(Collectors.toList());
|
||||
for (ConfigReportFieldDO configReportFieldCalculated : configReportFieldCalculatedList) {
|
||||
if (StringUtils.isNotBlank(configReportFieldCalculated.getFormula())) {
|
||||
//获取公式中的参数
|
||||
Set<String> outVarNames = express4Runner.getOutVarNames(configReportFieldCalculated.getFormula());
|
||||
for (String calcField : outVarNames) {
|
||||
if (!calcContext.containsKey(calcField)) {
|
||||
calcContext.put(calcField, BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
QLResult expressResult = express4Runner.execute(configReportFieldCalculated.getFormula(), calcContext, QLOptions.builder().precise(true).build());//高精度计算
|
||||
BigDecimal calcValue = (BigDecimal) expressResult.getResult();
|
||||
|
||||
String mathSymbol = "=";
|
||||
List<String> mathSymbolList = assayDataJson.entrySet().stream().filter(f -> outVarNames.contains(f.getKey()) && !"=".equals(((ReportFieldValueData)f.getValue()).getMathSymbol())).map(f -> ((ReportFieldValueData)f.getValue()).getMathSymbol()).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(mathSymbolList)) {
|
||||
mathSymbol = mathSymbolList.get(0);
|
||||
}
|
||||
String unit = null;
|
||||
List<String> unitList = assayDataJson.entrySet().stream().filter(f -> outVarNames.contains(f.getKey())).map(f -> ((ReportFieldValueData)f.getValue()).getUnit()).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(mathSymbolList)) {
|
||||
unit = unitList.get(0);
|
||||
}
|
||||
|
||||
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
||||
reportFieldValueData.setFieldName(configReportFieldCalculated.getFieldName());
|
||||
reportFieldValueData.setFieldValue(calcValue.toPlainString());
|
||||
reportFieldValueData.setDataType(configReportFieldCalculated.getDataType());
|
||||
reportFieldValueData.setDecimalPosition(configReportFieldCalculated.getDecimalPosition());
|
||||
reportFieldValueData.setMathSymbol(mathSymbol);
|
||||
reportFieldValueData.setUnit(unit);
|
||||
reportFieldValueData.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
||||
reportFieldValueData.setMinLimitValue(null);
|
||||
reportFieldValueData.setMethodName(null);
|
||||
assayDataJson.put(configReportFieldCalculated.getField(), reportFieldValueData);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString());
|
||||
businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource));
|
||||
|
||||
}
|
||||
@@ -651,6 +725,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
for (BusinessSubParentSampleAssessmentProjectDO businessSubParentSampleAssessmentProjectDO : businessSubParentSampleAssessmentDOList) {
|
||||
BusinessSubSampleAssessmentProjectDO businessSubSampleAssessmentProjectDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||
businessSubParentSampleAssessmentProjectDO.setAssessmentValue(businessSubSampleAssessmentProjectDO.getAssessmentValue());
|
||||
businessSubParentSampleAssessmentProjectDO.setSymbol(businessSubSampleAssessmentProjectDO.getSymbol());
|
||||
}
|
||||
businessSubParentSampleAssessmentProjectMapper.updateBatch(businessSubParentSampleAssessmentDOList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user