Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -62,6 +62,13 @@ public class SampleTaskAssignController implements BusinessControllerMarker {
|
||||
List<AssayMethodProjectRespVO> list = sampleTaskAssignService.getAssayMethodProjectList(businessSubSampleIdList, configAssayMethodId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/getMaterialAssayStandardMethodProjectList")
|
||||
public CommonResult<?> getMaterialAssayStandardMethodProjectList(String businessSubSampleIds, Long baseSampleId, Long configAssayMethodId) {
|
||||
List<Long> businessSubSampleIdList = Arrays.asList(businessSubSampleIds.split(",")).stream().map(Long::parseLong).toList();
|
||||
List<AssayMethodProjectRespVO> list = sampleTaskAssignService.getMaterialAssayStandardMethodProjectList(businessSubSampleIdList, baseSampleId, configAssayMethodId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/changeMethod")
|
||||
public CommonResult<?> changeMethod(@RequestBody ChangeAssayMethodReqVO req) {
|
||||
@@ -111,6 +118,11 @@ public class SampleTaskAssignController implements BusinessControllerMarker {
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 作废
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/voidAssign")
|
||||
public CommonResult<?> voidAssign(Long id) {
|
||||
sampleTaskAssignService.voidAssign(id);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -14,8 +14,14 @@ public class UnAssignTaskedSubSampleRespVO implements Serializable {
|
||||
@Schema(description = "联合id")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "样品大类ID", example = "15112")
|
||||
private Long baseSampleId;
|
||||
|
||||
@Schema(description = "分样子样ID")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
@Schema(description = "样品大类名称", example = "张三")
|
||||
private String baseSampleName;
|
||||
|
||||
@Schema(description = "样品名称", example = "张三")
|
||||
private String sampleName;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -150,11 +150,8 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
|
||||
businessSubSample.setSampleReceiver(businessSubSampleAnalysisGroupDO.getSampleReceiver());
|
||||
businessSubSample.setSampleReceiveTime(businessSubSampleAnalysisGroupDO.getSampleReceiveTime());
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleIdAndAssayDepartmentId(id, loginUser.getVisitDeptId());
|
||||
Map<Long, List<BusinessAssayTaskDataDO>> businessAssayTaskDataDOMap = businessAssayTaskDataDOList.stream().collect(Collectors.groupingBy(BusinessAssayTaskDataDO::getConfigAssayMethodId));
|
||||
List<String> assayProjectList = new ArrayList<>();
|
||||
for (Map.Entry<Long, List<BusinessAssayTaskDataDO>> entry : businessAssayTaskDataDOMap.entrySet()) {
|
||||
List<BusinessAssayTaskDataDO> val = entry.getValue();
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = val.get(0);
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) {
|
||||
String assayProject = businessAssayTaskDataDO.getAssayProject();
|
||||
String[] split = assayProject.split(",");
|
||||
for (String s : split) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,14 @@ public interface SampleTaskAssignService {
|
||||
*/
|
||||
List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId);
|
||||
|
||||
/**
|
||||
* 根据大样id,分析方法 查询检测标准中分析方法项目
|
||||
* @param baseSampleId 大样id
|
||||
* @param configAssayMethodId 分析方法id
|
||||
* @return
|
||||
*/
|
||||
List<AssayMethodProjectRespVO> getMaterialAssayStandardMethodProjectList(List<Long> businessSubSampleIdList, Long baseSampleId, Long configAssayMethodId);
|
||||
|
||||
/**
|
||||
* 修改分析方法
|
||||
* @param req
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodPro
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigQCSampleMethodParameterExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodParameterDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||
@@ -70,6 +71,7 @@ import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjec
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigQCSampleMethodParameterMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.MaterialAssayStandardMethodMapper;
|
||||
import com.zt.plat.module.qms.business.dic.dal.mapper.DictionaryProjectMapper;
|
||||
import com.zt.plat.module.qms.core.code.SequenceUtil;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
@@ -164,6 +166,9 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
|
||||
@Resource
|
||||
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private MaterialAssayStandardMethodMapper materialAssayStandardMethodMapper;
|
||||
|
||||
@Override
|
||||
public List<AdminUserRespDTO> getAssignUserList() {
|
||||
@@ -198,6 +203,9 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过子样方法检测项目
|
||||
*/
|
||||
@Override
|
||||
public List<AssayMethodProjectRespVO> getAssayMethodProjectList(List<Long> businessSubSampleIdList, Long configAssayMethodId) {
|
||||
//当前登录用户
|
||||
@@ -216,6 +224,38 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AssayMethodProjectRespVO> getMaterialAssayStandardMethodProjectList(List<Long> businessSubSampleIdList, Long baseSampleId, Long configAssayMethodId) {
|
||||
//当前登录用户
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Long visitDeptId = loginUser.getVisitDeptId();
|
||||
//查询子样
|
||||
// List<BusinessSubSampleDO> businessSubSampleList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
//子样配置id
|
||||
// List<Long> configSubSampleIdList = businessSubSampleList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
//查询子样分析方法及检测项目
|
||||
// List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigSubSampleIdsAndAssayDepartmentId(configSubSampleIdList, visitDeptId);
|
||||
|
||||
//查询分析方法检测项目
|
||||
List<AssayMethodProjectRespVO> list = businessAssayProjectDataMapper.selectAssayMethodProjectByBusinessSubSampleIdListAndConfigAssayMethodId(businessSubSampleIdList, configAssayMethodId);
|
||||
|
||||
List<Long> dictionaryProjectIdList = list.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList());
|
||||
|
||||
List<MaterialAssayStandardMethodExtendRespVO> materialAssayStandardMethodList = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectIdsAndAssayDepartmentId(baseSampleId, dictionaryProjectIdList, visitDeptId);
|
||||
|
||||
for (AssayMethodProjectRespVO assayMethodProject : list) {
|
||||
List<ConfigAssayMethodProjectExtendRespVO> methodList = materialAssayStandardMethodList.stream().filter(f -> assayMethodProject.getDictionaryProjectId().equals(f.getDictionaryProjectId())).map(m -> {
|
||||
ConfigAssayMethodProjectExtendRespVO configAssayMethod = new ConfigAssayMethodProjectExtendRespVO();
|
||||
configAssayMethod.setConfigAssayMethodId(m.getConfigAssayMethodId());
|
||||
configAssayMethod.setConfigAssayMethodName(m.getConfigAssayMethodName());
|
||||
configAssayMethod.setConfigAssayMethodNameAndCategory(m.getConfigAssayMethodNameAndCategory());
|
||||
return configAssayMethod;
|
||||
}).collect(Collectors.toList());
|
||||
assayMethodProject.setMethodList(methodList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -734,6 +774,8 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) {
|
||||
businessAssayTaskDataDO.setBusinessAssayTaskId(null);
|
||||
businessAssayTaskDataDO.setAssayOperatorId(null);
|
||||
businessAssayTaskDataDO.setAssayOperator(null);
|
||||
businessAssayTaskDataDO.setAssignTaskTime(null);
|
||||
businessAssayTaskDataDO.setIsAssignTasked(0);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MaterialAssayStandardMethodExtendRespVO extends MaterialAssayStandardMethodRespVO {
|
||||
|
||||
@Schema(description = "检测项目id")
|
||||
private Long dictionaryProjectId;
|
||||
|
||||
@Schema(description = "分析方法名称")
|
||||
private String configAssayMethodName;
|
||||
|
||||
@Schema(description = "检测方法配置名称及类别")
|
||||
private String configAssayMethodNameAndCategory;
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectPageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
@@ -73,12 +70,12 @@ public interface ConfigAssayMethodProjectMapper extends BaseMapperX<ConfigAssayM
|
||||
* @return
|
||||
*/
|
||||
default List<ConfigAssayMethodProjectExtendRespVO> selectByConfigSubSampleIdsAndAssayDepartmentId(List<Long> configSubSampleIds, Long assayDepartmentId) {
|
||||
StringBuilder inSql = new StringBuilder("SELECT tcssm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm WHERE tcssm.DELETED = 0 AND tcssm.CFG_SB_SMP_ID IN (");
|
||||
StringBuilder inSql = new StringBuilder("SELECT tcsspm.CFG_ASY_MTHD_ID FROM T_CFG_SB_SMP_MTHD tcssm LEFT JOIN T_CFG_SB_SMP_PRN_MTHD tcsspm ON tcssm.CFG_SB_SMP_PRN_MTHD_ID = tcsspm.ID WHERE tcssm.DELETED = 0 AND tcsspm.DELETED = 0 AND tcssm.CFG_SB_SMP_ID IN (");
|
||||
for (Long configSubSampleId : configSubSampleIds) {
|
||||
inSql.append(configSubSampleId).append(",");
|
||||
}
|
||||
inSql.delete(inSql.length() - 1, inSql.length());
|
||||
inSql.append(")");
|
||||
inSql.append(")");
|
||||
return selectJoinList(ConfigAssayMethodProjectExtendRespVO.class, new MPJLambdaWrapperX<ConfigAssayMethodProjectDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigAssayMethodProjectDO::getConfigAssayMethodId)
|
||||
.selectAll(ConfigAssayMethodProjectDO.class)
|
||||
|
||||
@@ -4,12 +4,16 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.MaterialAssayStandardMethodPageReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardDetailDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.MaterialAssayStandardMethodDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -50,4 +54,19 @@ public interface MaterialAssayStandardMethodMapper extends BaseMapperX<MaterialA
|
||||
.eq(MaterialAssayStandardMethodDO::getIsDefault, QmsCommonConstant.YES));
|
||||
}
|
||||
|
||||
default List<MaterialAssayStandardMethodExtendRespVO> selectByBaseSampleIdAndDictionaryProjectIdsAndAssayDepartmentId(Long baseSampleId, List<Long> dictionaryProjectIdList, Long assayDepartmentId) {
|
||||
return selectJoinList(MaterialAssayStandardMethodExtendRespVO.class, new MPJLambdaWrapperX<MaterialAssayStandardMethodDO>()
|
||||
.leftJoin(MaterialAssayStandardDetailDO.class, MaterialAssayStandardDetailDO::getId, MaterialAssayStandardMethodDO::getMaterialAssayStandardDetailId)
|
||||
.leftJoin(MaterialAssayStandardDO.class, MaterialAssayStandardDO::getId, MaterialAssayStandardDetailDO::getMaterialAssayStandardId)
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, MaterialAssayStandardMethodDO::getConfigAssayMethodId)
|
||||
.selectAll(MaterialAssayStandardMethodDO.class)
|
||||
.selectAs(MaterialAssayStandardDetailDO::getDictionaryProjectId, MaterialAssayStandardMethodExtendRespVO::getDictionaryProjectId)
|
||||
.selectAs(ConfigAssayMethodDO::getName, MaterialAssayStandardMethodExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(ConfigAssayMethodDO::getMethodNameCategory, MaterialAssayStandardMethodExtendRespVO::getConfigAssayMethodNameAndCategory)
|
||||
.eq(MaterialAssayStandardDO::getBaseSampleId, baseSampleId)
|
||||
.in(MaterialAssayStandardDetailDO::getDictionaryProjectId, dictionaryProjectIdList)
|
||||
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -126,6 +126,8 @@
|
||||
tbss.SMP_ASY_CD AS sampleAssayCode,
|
||||
tbss.SMP_RTN_CD AS sampleReturnCode,
|
||||
tbss.SMP_FLW_NDE_TM AS sampleFlowNodeTime,
|
||||
tcbs.BSE_SMP_ID AS baseSampleId,
|
||||
tbbs.BSE_SMP_NAME AS baseSampleName,
|
||||
tbatd.BSN_SB_SMP_ID AS businessSubSampleId,
|
||||
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
tcam.NAME AS configAssayMethodName,
|
||||
@@ -139,7 +141,11 @@
|
||||
LEFT JOIN T_BSN_SB_SMP tbss ON
|
||||
tbatd.BSN_SB_SMP_ID = tbss.ID
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tbatd.CFG_ASY_MTHD_ID = tcam.ID
|
||||
tbatd.CFG_ASY_MTHD_ID = tcam.ID
|
||||
LEFT JOIN T_BSN_BSE_SMP tbbs ON
|
||||
tbatd.BSN_BSE_SMP_ID = tbbs.ID
|
||||
LEFT JOIN T_CFG_BSE_SMP tcbs ON
|
||||
tbbs.CFG_BSE_SMP_ID = tcbs.ID
|
||||
WHERE
|
||||
tbatd.DELETED = 0
|
||||
AND tbatd.IS_ASN_TSKD = 0
|
||||
@@ -173,6 +179,8 @@
|
||||
tbss.SMP_ASY_CD,
|
||||
tbss.SMP_RTN_CD,
|
||||
tbss.SMP_FLW_NDE_TM,
|
||||
tcbs.BSE_SMP_ID,
|
||||
tbbs.BSE_SMP_NAME,
|
||||
tbatd.BSN_SB_SMP_ID,
|
||||
tbatd.CFG_ASY_MTHD_ID,
|
||||
tcam.NAME,
|
||||
|
||||
Reference in New Issue
Block a user