修改分析方法
This commit is contained in:
@@ -141,27 +141,27 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-spring-boot-starter</artifactId>
|
<artifactId>liteflow-spring-boot-starter</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-javax-pro</artifactId>
|
<artifactId>liteflow-script-javax-pro</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-groovy</artifactId>
|
<artifactId>liteflow-script-groovy</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-qlexpress</artifactId>
|
<artifactId>liteflow-script-qlexpress</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.yomahub</groupId>
|
<groupId>com.yomahub</groupId>
|
||||||
<artifactId>liteflow-script-graaljs</artifactId>
|
<artifactId>liteflow-script-graaljs</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- pdfbox -->
|
<!-- pdfbox -->
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class SampleEntrustController {
|
|||||||
if (response.isSuccess()) {
|
if (response.isSuccess()) {
|
||||||
return success(response.getContextBean(SampleEntrustContext.class));
|
return success(response.getContextBean(SampleEntrustContext.class));
|
||||||
} else {
|
} else {
|
||||||
return error(500, response.getMessage());
|
return error(1_032_100_000, response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ public class SampleEntrustController {
|
|||||||
if (response.isSuccess()) {
|
if (response.isSuccess()) {
|
||||||
return success(response.getContextBean(SampleEntrustContext.class));
|
return success(response.getContextBean(SampleEntrustContext.class));
|
||||||
} else {
|
} else {
|
||||||
return error(500, response.getMessage());
|
return error(1_032_100_000, response.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public class SampleFlowController {
|
|||||||
if (response.isSuccess()) {
|
if (response.isSuccess()) {
|
||||||
return success(response.getContextBean(SampleFlowContext.class));
|
return success(response.getContextBean(SampleFlowContext.class));
|
||||||
} else {
|
} else {
|
||||||
return error(500, response.getMessage());
|
return error(1_032_100_000, response.getMessage());
|
||||||
}
|
}
|
||||||
//return success(FlowBus.getNodeMap());
|
//return success(FlowBus.getNodeMap());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
||||||
@@ -38,10 +39,21 @@ public class SampleTaskAssignController {
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getAssaySampleList")
|
||||||
|
public CommonResult<?> getAssaySampleList() {
|
||||||
|
List<UnAssignTaskedSubSampleRespVO> list = sampleTaskAssignService.getAssaySampleList();
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getAssayMethodList")
|
||||||
|
public CommonResult<?> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
|
List<Object> list = sampleTaskAssignService.getAssayMethodList(businessSubSampleId, configAssayMethodId);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/changeMethod")
|
@PostMapping("/changeMethod")
|
||||||
public CommonResult<?> changeMethod() {
|
public CommonResult<?> changeMethod(@RequestBody ChangeAssayMethodReqVO req) {
|
||||||
|
sampleTaskAssignService.changeMethod(req);
|
||||||
|
|
||||||
return success("成功");
|
return success("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ChangeAssayMethodReqVO {
|
||||||
|
|
||||||
|
private Long businessSubSampleId;
|
||||||
|
|
||||||
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
private List<Long> changeConfigAssayMethodIdList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UnAssignTaskedSubSampleRespVO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -6009144013166409560L;
|
||||||
|
|
||||||
|
@Schema(description = "联合id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "分样子样ID")
|
||||||
|
private Long businessSubSampleId;
|
||||||
|
|
||||||
|
@Schema(description = "样品名称", example = "张三")
|
||||||
|
private String sampleName;
|
||||||
|
|
||||||
|
@Schema(description = "样品编号")
|
||||||
|
private String sampleCode;
|
||||||
|
|
||||||
|
@Schema(description = "分析编号")
|
||||||
|
private String sampleAssayCode;
|
||||||
|
|
||||||
|
@Schema(description = "归库编号")
|
||||||
|
private String sampleReturnCode;
|
||||||
|
|
||||||
|
@Schema(description = "样品流程节点时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private LocalDateTime sampleFlowNodeTime;
|
||||||
|
|
||||||
|
@Schema(description = "检测方法配置ID", example = "9130")
|
||||||
|
private Long configAssayMethodId;
|
||||||
|
|
||||||
|
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯、双杯、平行...", example = "2")
|
||||||
|
private String assayType;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目")
|
||||||
|
private String assayProject;
|
||||||
|
|
||||||
|
@Schema(description = "分析部门ID", example = "16988")
|
||||||
|
private Long assayDepartmentId;
|
||||||
|
|
||||||
|
@Schema(description = "分析部门名称", example = "芋艿")
|
||||||
|
private String assayDepartmentName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -171,6 +171,40 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样查询分析任务
|
||||||
|
* @param businessSubSampleId 子样id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default List<BusinessAssayTaskDataDO> selectByBusinessSubSampleId(Long businessSubSampleId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样查询分析任务
|
||||||
|
* @param businessSubSampleId 子样id
|
||||||
|
* @param configAssayMethodId 分析方法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default List<BusinessAssayTaskDataDO> selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, businessSubSampleId)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据分样查询分析任务
|
||||||
|
* @param businessSubParentSampleId 分样样id
|
||||||
|
* @param configAssayMethodId 分析方法
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
default List<BusinessAssayTaskDataDO> selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||||
|
.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleId)
|
||||||
|
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询是否上报的分析任务
|
* 查询是否上报的分析任务
|
||||||
* @param excludeIds 排除的id列表
|
* @param excludeIds 排除的id列表
|
||||||
@@ -211,4 +245,9 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询未指派的子样
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UnAssignTaskedSubSampleRespVO> selectUnAssignTaskedSubSample();
|
||||||
}
|
}
|
||||||
@@ -24,11 +24,11 @@ public class SampleEntrustCheckCmp extends NodeComponent {
|
|||||||
|
|
||||||
|
|
||||||
if (sampleEntrustRegistration.getConfigEntrustSourceId() == null) {
|
if (sampleEntrustRegistration.getConfigEntrustSourceId() == null) {
|
||||||
throw new ServiceException(500, "委托来源id不允许为空");
|
throw new ServiceException(1_032_100_000, "委托来源id不允许为空");
|
||||||
}
|
}
|
||||||
ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId());
|
ConfigEntrustSourceDO configEntrustSource = sampleEntrustContext.getConfigEntrustSourceById(sampleEntrustRegistration.getConfigEntrustSourceId());
|
||||||
if (configEntrustSource == null) {
|
if (configEntrustSource == null) {
|
||||||
throw new ServiceException(500, "委托来源id不正确");
|
throw new ServiceException(1_032_100_000, "委托来源id不正确");
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleEntrustRegistration.setDataCheckStatus(QmsCommonConstant.SUCCESS);
|
sampleEntrustRegistration.setDataCheckStatus(QmsCommonConstant.SUCCESS);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class SampleEntrustContextInitCmp extends NodeComponent {
|
|||||||
SampleEntrustParam sampleEntrustParam = this.getRequestData();
|
SampleEntrustParam sampleEntrustParam = this.getRequestData();
|
||||||
|
|
||||||
if (sampleEntrustParam == null) {
|
if (sampleEntrustParam == null) {
|
||||||
throw new ServiceException(500, "样品委托参数不允许为空");
|
throw new ServiceException(1_032_100_000, "样品委托参数不允许为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取样品委托上下文
|
//获取样品委托上下文
|
||||||
@@ -99,14 +99,14 @@ public class SampleEntrustContextInitCmp extends NodeComponent {
|
|||||||
|
|
||||||
//委托来源id为空并且委托来源key也为空
|
//委托来源id为空并且委托来源key也为空
|
||||||
if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isBlank(sampleEntrustParam.getConfigEntrustSourceKey())) {
|
if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isBlank(sampleEntrustParam.getConfigEntrustSourceKey())) {
|
||||||
throw new ServiceException(500, "委托来源id或委托来源key为空");
|
throw new ServiceException(1_032_100_000, "委托来源id或委托来源key为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
//委托来源的id为空
|
//委托来源的id为空
|
||||||
if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isNotBlank(sampleEntrustParam.getConfigEntrustSourceKey()) && StringUtils.isNotBlank(sampleEntrustParam.getEntrustType())) {
|
if (sampleEntrustParam.getConfigEntrustSourceId() == null && StringUtils.isNotBlank(sampleEntrustParam.getConfigEntrustSourceKey()) && StringUtils.isNotBlank(sampleEntrustParam.getEntrustType())) {
|
||||||
ConfigEntrustSourceDO configEntrustSourceDO = configEntrustSourceList.stream().filter(f -> f.getKey().equals(sampleEntrustParam.getConfigEntrustSourceKey()) && f.getEntrustType().equals(sampleEntrustParam.getEntrustType())).findFirst().orElse(null);
|
ConfigEntrustSourceDO configEntrustSourceDO = configEntrustSourceList.stream().filter(f -> f.getKey().equals(sampleEntrustParam.getConfigEntrustSourceKey()) && f.getEntrustType().equals(sampleEntrustParam.getEntrustType())).findFirst().orElse(null);
|
||||||
if (configEntrustSourceDO == null) {
|
if (configEntrustSourceDO == null) {
|
||||||
throw new ServiceException(500, "样品委托来源不正确");
|
throw new ServiceException(1_032_100_000, "样品委托来源不正确");
|
||||||
}
|
}
|
||||||
sampleEntrustRegistration.setConfigEntrustSourceId(configEntrustSourceDO.getId());
|
sampleEntrustRegistration.setConfigEntrustSourceId(configEntrustSourceDO.getId());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//查询当前委托样品对应的子样
|
//查询当前委托样品对应的子样
|
||||||
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
||||||
if (entrustConfigSubSampleList.size() != 1) {
|
if (entrustConfigSubSampleList.size() != 1) {
|
||||||
throw new ServiceException(500, "子样配置不正确");
|
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
||||||
}
|
}
|
||||||
//获取到子样配置
|
//获取到子样配置
|
||||||
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
||||||
|
|||||||
@@ -41,11 +41,11 @@ public class SampleFlowContextInitCmp extends NodeComponent {
|
|||||||
SampleFlowParam sampleFlowParam = this.getRequestData();
|
SampleFlowParam sampleFlowParam = this.getRequestData();
|
||||||
|
|
||||||
if (StringUtils.isBlank(sampleFlowParam.getCurrentSampleFlowKey())) {
|
if (StringUtils.isBlank(sampleFlowParam.getCurrentSampleFlowKey())) {
|
||||||
new ServiceException(500, "样品流程节点currentSampleFlowKey不允许为空");
|
new ServiceException(1_032_100_000, "样品流程节点currentSampleFlowKey不允许为空");
|
||||||
}
|
}
|
||||||
List<SampleFlowInfo> sampleFlowInfoList = sampleFlowParam.getSampleFlowInfoList();
|
List<SampleFlowInfo> sampleFlowInfoList = sampleFlowParam.getSampleFlowInfoList();
|
||||||
if (CollUtil.isEmpty(sampleFlowInfoList)) {
|
if (CollUtil.isEmpty(sampleFlowInfoList)) {
|
||||||
new ServiceException(500, "样品流转列表不允许为空");
|
new ServiceException(1_032_100_000, "样品流转列表不允许为空");
|
||||||
}
|
}
|
||||||
List<Long> sampleIdList = sampleFlowInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
List<Long> sampleIdList = sampleFlowInfoList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
SampleFlowContext sampleFlowContext = this.getContextBean(SampleFlowContext.class);
|
SampleFlowContext sampleFlowContext = this.getContextBean(SampleFlowContext.class);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class SampleSubCheckCmp extends NodeComponent {
|
|||||||
String currentSampleFlowKey = sampleFlowContext.getCurrentSampleFlowKey();
|
String currentSampleFlowKey = sampleFlowContext.getCurrentSampleFlowKey();
|
||||||
List<Long> sampleIdList = sampleFlowContext.getSampleIdList();
|
List<Long> sampleIdList = sampleFlowContext.getSampleIdList();
|
||||||
if (CollUtil.isEmpty(sampleIdList)) {
|
if (CollUtil.isEmpty(sampleIdList)) {
|
||||||
throw new ServiceException(500, "样品ID列表不允许为空");
|
throw new ServiceException(1_032_100_000, "样品ID列表不允许为空");
|
||||||
}
|
}
|
||||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(sampleIdList);
|
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(sampleIdList);
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ public class SampleSubCheckCmp extends NodeComponent {
|
|||||||
|
|
||||||
boolean isSampleFlowKeyFail = businessSubSampleDOList.stream().anyMatch(p -> !p.getSampleFlowNodeKey().equals(currentSampleFlowKey));
|
boolean isSampleFlowKeyFail = businessSubSampleDOList.stream().anyMatch(p -> !p.getSampleFlowNodeKey().equals(currentSampleFlowKey));
|
||||||
if (isSampleFlowKeyFail) {
|
if (isSampleFlowKeyFail) {
|
||||||
throw new ServiceException(500, "样品列表与当前流程不符");
|
throw new ServiceException(1_032_100_000, "样品列表与当前流程不符");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
// 查找匹配的允差规则
|
// 查找匹配的允差规则
|
||||||
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
||||||
if (matchedRule == null) {
|
if (matchedRule == null) {
|
||||||
throw new ServiceException(500, "未找到超差判定区间范围,元素ID: " + dictionaryProjectId + ", 值: " + representativeValue);
|
throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + dictionaryProjectId + ", 值: " + representativeValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算允差值
|
// 计算允差值
|
||||||
@@ -344,7 +344,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
try {
|
try {
|
||||||
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(500, "超差判定计算出错,检测项目ID: " + dictionaryProjectId);
|
throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + dictionaryProjectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断相邻差值是否超差
|
// 判断相邻差值是否超差
|
||||||
@@ -477,7 +477,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.NO);
|
List<BusinessAssayTaskDataDO> unReportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.NO);
|
||||||
if (unReportedList.size() > 0) {
|
if (unReportedList.size() > 0) {
|
||||||
throw new ServiceException(500, "存在未上报的数据");
|
throw new ServiceException(1_032_100_000, "存在未上报的数据");
|
||||||
}
|
}
|
||||||
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
@@ -605,7 +605,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
//子样配置数据
|
//子样配置数据
|
||||||
ConfigSubSampleDO configSubSampleDO = configSubSampleMapper.selectById(businessSubSampleDO.getConfigSubSampleId());
|
ConfigSubSampleDO configSubSampleDO = configSubSampleMapper.selectById(businessSubSampleDO.getConfigSubSampleId());
|
||||||
if (StringUtils.isBlank(configSubSampleDO.getRecheckFlowNodeKey())) {
|
if (StringUtils.isBlank(configSubSampleDO.getRecheckFlowNodeKey())) {
|
||||||
throw new ServiceException(500, "未配置复检流程,不能发起复检委托!");
|
throw new ServiceException(1_032_100_000, "未配置复检流程,不能发起复检委托!");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BusinessAssayTaskDataDO> newBusinessAssayTaskDataDOList = new ArrayList<>();
|
List<BusinessAssayTaskDataDO> newBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||||
@@ -752,7 +752,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
// 查找匹配的允差规则
|
// 查找匹配的允差规则
|
||||||
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
ConfigAssayMethodProjectAssessmentDO matchedRule = findMatchingRule(configAssayMethodProjectAssessmentDOList, representativeValue);
|
||||||
if (matchedRule == null) {
|
if (matchedRule == null) {
|
||||||
throw new ServiceException(500, "未找到超差判定区间范围,元素ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId() + ", 值: " + representativeValue);
|
throw new ServiceException(1_032_100_000, "未找到超差判定区间范围,元素ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId() + ", 值: " + representativeValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算允差值
|
// 计算允差值
|
||||||
@@ -760,7 +760,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
|||||||
try {
|
try {
|
||||||
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
allowValue = allowanceCalculatorComponent.calculateAllowableValue(new BigDecimal(matchedRule.getMinimumValue()), new BigDecimal(matchedRule.getMaximumValue()), new BigDecimal(matchedRule.getMinimumToleraanceValue()), new BigDecimal(matchedRule.getMaximumToleraanceValue()), new BigDecimal(matchedRule.getToleraanceAdjustmentValue()), representativeValue, matchedRule.getIsUseFormula(), matchedRule.getFormula(), elementScale);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException(500, "超差判定计算出错,检测项目ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId());
|
throw new ServiceException(1_032_100_000, "超差判定计算出错,检测项目ID: " + businessSubSampleAssessmentDO.getDictionaryProjectId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断相邻差值是否超差
|
// 判断相邻差值是否超差
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
|||||||
BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO();
|
BusinessAssayTaskAnalysisSampleProjectRespVO businessAssayTaskAnalysisSampleProjectRespVO = new BusinessAssayTaskAnalysisSampleProjectRespVO();
|
||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(businessAssayTaskId);
|
||||||
if (businessAssayTaskDO == null) {
|
if (businessAssayTaskDO == null) {
|
||||||
throw new ServiceException(500, "未找到任务分配单");
|
throw new ServiceException(1_032_100_000, "未找到任务分配单");
|
||||||
}
|
}
|
||||||
businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTaskId(businessAssayTaskId);
|
businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTaskId(businessAssayTaskId);
|
||||||
businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTasNo(businessAssayTaskDO.getTaskNo());
|
businessAssayTaskAnalysisSampleProjectRespVO.setBusinessAssayTasNo(businessAssayTaskDO.getTaskNo());
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("创建委托登记失败", response.getCause());
|
log.error("创建委托登记失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("更新委托登记失败", response.getCause());
|
log.error("更新委托登记失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -120,10 +120,10 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void delete(Long id) {
|
public void delete(Long id) {
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
throw new ServiceException(500, "委托登记id不允许为空");
|
throw new ServiceException(1_032_100_000, "委托登记id不允许为空");
|
||||||
}
|
}
|
||||||
if (businessSampleEntrustRegistrationMapper.selectById(id) == null) {
|
if (businessSampleEntrustRegistrationMapper.selectById(id) == null) {
|
||||||
throw new ServiceException(500, "委托登记业务不存在");
|
throw new ServiceException(1_032_100_000, "委托登记业务不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, id));
|
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, id));
|
||||||
@@ -154,11 +154,11 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteList(List<Long> ids) {
|
public void deleteList(List<Long> ids) {
|
||||||
if (ids == null || ids.size() <= 0) {
|
if (ids == null || ids.size() <= 0) {
|
||||||
throw new ServiceException(500, "委托登记id列表不允许为空");
|
throw new ServiceException(1_032_100_000, "委托登记id列表不允许为空");
|
||||||
}
|
}
|
||||||
List<BusinessSampleEntrustRegistrationDO> sampleEntrustRegistrationList = businessSampleEntrustRegistrationMapper.selectByIds(ids);
|
List<BusinessSampleEntrustRegistrationDO> sampleEntrustRegistrationList = businessSampleEntrustRegistrationMapper.selectByIds(ids);
|
||||||
if (CollUtil.isEmpty(sampleEntrustRegistrationList) || sampleEntrustRegistrationList.size() != ids.size()) {
|
if (CollUtil.isEmpty(sampleEntrustRegistrationList) || sampleEntrustRegistrationList.size() != ids.size()) {
|
||||||
throw new ServiceException(500, "委托登记业务不存在");
|
throw new ServiceException(1_032_100_000, "委托登记业务不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, ids));
|
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailList = businessSampleEntrustDetailMapper.selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().in(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, ids));
|
||||||
@@ -190,7 +190,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = businessSampleEntrustRegistrationMapper.selectById(req.getId());
|
BusinessSampleEntrustRegistrationDO sampleEntrustRegistration = businessSampleEntrustRegistrationMapper.selectById(req.getId());
|
||||||
if (sampleEntrustRegistration == null) {
|
if (sampleEntrustRegistration == null) {
|
||||||
throw new ServiceException(500, "委托登记业务不存在");
|
throw new ServiceException(1_032_100_000, "委托登记业务不存在");
|
||||||
}
|
}
|
||||||
SampleEntrustParam sampleEntrustParam = BeanUtils.toBean(sampleEntrustRegistration, SampleEntrustParam.class);
|
SampleEntrustParam sampleEntrustParam = BeanUtils.toBean(sampleEntrustRegistration, SampleEntrustParam.class);
|
||||||
sampleEntrustParam.setIsReceiveSample(req.getIsReceiveSample());
|
sampleEntrustParam.setIsReceiveSample(req.getIsReceiveSample());
|
||||||
@@ -217,7 +217,7 @@ public class SampleEntrustServiceImpl implements SampleEntrustService {
|
|||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleEntrustSubmitChain" + tenantId, sampleEntrustParam, SampleEntrustContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("提交委托登记失败", response.getCause());
|
log.error("提交委托登记失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class SampleFlowServiceImpl implements SampleFlowService {
|
|||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleFlowChain" + tenantId, sampleFlowParam, SampleFlowContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("样品流转失败", response.getCause());
|
log.error("样品流转失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
||||||
@@ -17,6 +18,26 @@ public interface SampleTaskAssignService {
|
|||||||
*/
|
*/
|
||||||
List<AdminUserRespDTO> getAssignUserList();
|
List<AdminUserRespDTO> getAssignUserList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取未指派任务子样信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UnAssignTaskedSubSampleRespVO> getAssaySampleList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子样id查询分析方法
|
||||||
|
* @param businessSubSampleId
|
||||||
|
* @param configAssayMethodId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分析方法
|
||||||
|
* @param req
|
||||||
|
*/
|
||||||
|
void changeMethod(ChangeAssayMethodReqVO req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按方法分配任务
|
* 按方法分配任务
|
||||||
* @param param
|
* @param param
|
||||||
@@ -54,4 +75,5 @@ public interface SampleTaskAssignService {
|
|||||||
*/
|
*/
|
||||||
void removeAssignTaskDetail(BatchDeleteReqVO req);
|
void removeAssignTaskDetail(BatchDeleteReqVO req);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ package com.zt.plat.module.qms.business.bus.service;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
import com.yomahub.liteflow.core.FlowExecutor;
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
|
|
||||||
@@ -19,16 +23,33 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|||||||
import com.zt.plat.framework.security.core.LoginUser;
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||||
|
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.BusinessAssayReportDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDetailDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDetailMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||||
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignManualParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignMethodParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleTaskAssignSampleParam;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleTaskAssignContext;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodExtendRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectParameterMapper;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||||
|
import com.zt.plat.module.qms.business.dic.dal.mapper.DictionaryProjectMapper;
|
||||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
import com.zt.plat.module.system.api.dept.DeptApi;
|
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||||
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
||||||
@@ -56,9 +77,33 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
@Resource
|
@Resource
|
||||||
private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper;
|
private BusinessAssayTaskDetailMapper businessAssayTaskDetailMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessSubSampleMapper businessSubSampleMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessAssayReportDataMapper businessAssayReportDataMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DictionaryProjectMapper dictionaryProjectMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdminUserRespDTO> getAssignUserList() {
|
public List<AdminUserRespDTO> getAssignUserList() {
|
||||||
//当前登录用户
|
//当前登录用户
|
||||||
@@ -80,20 +125,221 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
return userListResult.getCheckedData();
|
return userListResult.getCheckedData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UnAssignTaskedSubSampleRespVO> getAssaySampleList() {
|
||||||
|
List<UnAssignTaskedSubSampleRespVO> list = businessAssayTaskDataMapper.selectUnAssignTaskedSubSample();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Object> getAssayMethodList(Long businessSubSampleId, Long configAssayMethodId) {
|
||||||
|
List<Object> resutList = new ArrayList<>();
|
||||||
|
//当前登录用户
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Long visitDeptId = loginUser.getVisitDeptId();
|
||||||
|
|
||||||
|
//子样
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleId);
|
||||||
|
//原检测项目
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> oldConfigAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
||||||
|
//原检测项目字典id列表
|
||||||
|
List<Long> oldDictionaryProjectIdList = oldConfigAssayMethodProjectList.stream().map(m -> m.getDictionaryProjectId()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
//子样对应的检测任务
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubSampleId(businessSubSampleId);
|
||||||
|
|
||||||
|
//查询子样配置的方法
|
||||||
|
List<ConfigSubSampleMethodExtendRespVO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIdAndAssayDepartmentId(businessSubSampleDO.getConfigSubSampleId(), visitDeptId);
|
||||||
|
|
||||||
|
JSONObject jsonObject = null;
|
||||||
|
for (ConfigSubSampleMethodExtendRespVO configSubSampleMethod : configSubSampleMethodList) {
|
||||||
|
jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("configAssayMethodId", configSubSampleMethod.getConfigAssayMethodId());
|
||||||
|
jsonObject.put("configAssayMethodName", configSubSampleMethod.getConfigAssayMethodName());
|
||||||
|
jsonObject.put("configAssayMethodCode", configSubSampleMethod.getConfigAssayMethodCode());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configSubSampleMethod.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
//判定是否存在原检测项目
|
||||||
|
boolean isExistProject = configAssayMethodProjectList.stream().anyMatch(m -> oldDictionaryProjectIdList.contains(m.getDictionaryProjectId()));
|
||||||
|
if (!isExistProject) {//如果不存在,则跳出循环
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectList) {
|
||||||
|
assayProjectBuilder.append(configAssayMethodProject.getShowName()).append(",");
|
||||||
|
}
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
|
||||||
|
jsonObject.put("assayProject", assayProjectBuilder.toString());
|
||||||
|
|
||||||
|
boolean checked = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()));
|
||||||
|
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getConfigAssayMethodId().equals(configSubSampleMethod.getConfigAssayMethodId()) && m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
||||||
|
jsonObject.put("checked", checked);
|
||||||
|
jsonObject.put("disabled", disabled);
|
||||||
|
|
||||||
|
resutList.add(jsonObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resutList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void changeMethod(ChangeAssayMethodReqVO req) {
|
||||||
|
|
||||||
|
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||||
|
List<BusinessAssayTaskDataDO> saveBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||||
|
List<BusinessAssayProjectDataDO> saveBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||||
|
List<BusinessAssayParameterDataDO> saveBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<Long> removeProjectIdList = new ArrayList<>();
|
||||||
|
List<Long> removeParameterIdList = new ArrayList<>();
|
||||||
|
//子样
|
||||||
|
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(req.getBusinessSubSampleId());
|
||||||
|
|
||||||
|
//查询检测任务
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleDO.getBusinessSubParentSampleId(), req.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
boolean disabled = businessAssayTaskDataDOList.stream().anyMatch(m -> m.getIsAssignTasked().equals(QmsCommonConstant.YES));
|
||||||
|
if (disabled) {
|
||||||
|
throw new ServiceException(10010, "当前样品存在已分配任务,不允许修改分析方法");
|
||||||
|
}
|
||||||
|
//查询报表数据
|
||||||
|
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
for (BusinessAssayReportDataDO businessAssayReportDataDO : businessAssayReportDataDOList) {
|
||||||
|
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||||
|
if (dataSource.contains(req.getConfigAssayMethodId().toString())) {//判定是否存在
|
||||||
|
List<Long> dataSourceList = new ArrayList<>();
|
||||||
|
String[] dataSourceSplit = dataSource.split(",");
|
||||||
|
for (int i = 0; i < dataSourceSplit.length; i++) {
|
||||||
|
dataSourceList.add(Long.parseLong(dataSourceSplit[i]));
|
||||||
|
}
|
||||||
|
//移除当前的
|
||||||
|
dataSourceList.remove(req.getConfigAssayMethodId());
|
||||||
|
//添加新的
|
||||||
|
dataSourceList.addAll(req.getChangeConfigAssayMethodIdList());
|
||||||
|
|
||||||
|
//重新赋值
|
||||||
|
businessAssayReportDataDO.setDataSource(CollUtil.join(dataSourceList, ","));
|
||||||
|
|
||||||
|
//添加到更新列表
|
||||||
|
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataDOList) {
|
||||||
|
//查询旧的
|
||||||
|
List<BusinessAssayProjectDataExtendRespVO> businessAssayProjectDataExtendRespVOs = businessAssayProjectDataMapper.selectByBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||||
|
List<Long> businessAssayProjectDataIdList = businessAssayProjectDataExtendRespVOs.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
removeProjectIdList.addAll(businessAssayProjectDataIdList);
|
||||||
|
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList = businessAssayParameterDataMapper.selectByBusinessAssayProjectDataIds(businessAssayProjectDataIdList);
|
||||||
|
List<Long> businessAssayParameterDataDOIdList = businessAssayParameterDataDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
|
removeParameterIdList.addAll(businessAssayParameterDataDOIdList);
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for (Long configAssayMethodId : req.getChangeConfigAssayMethodIdList()) {
|
||||||
|
Long businessAssayTaskDataId = null;
|
||||||
|
if (i == 0) {
|
||||||
|
businessAssayTaskDataId = businessAssayTaskDataDO.getId();
|
||||||
|
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
||||||
|
} else {
|
||||||
|
businessAssayTaskDataId = IdWorker.getId();
|
||||||
|
BusinessAssayTaskDataDO newBusinessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||||
|
newBusinessAssayTaskDataDO.setId(businessAssayTaskDataId);
|
||||||
|
newBusinessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
newBusinessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
newBusinessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
newBusinessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
||||||
|
newBusinessAssayTaskDataDO.setAssayType(businessAssayTaskDataDO.getAssayType());
|
||||||
|
newBusinessAssayTaskDataDO.setTaskType(businessAssayTaskDataDO.getTaskType());
|
||||||
|
newBusinessAssayTaskDataDO.setConfigSampleFlowId(businessAssayTaskDataDO.getConfigSampleFlowId());
|
||||||
|
newBusinessAssayTaskDataDO.setSampleFlowNodeKey(businessAssayTaskDataDO.getSampleFlowNodeKey());
|
||||||
|
newBusinessAssayTaskDataDO.setSampleFlowNodeTime(businessAssayTaskDataDO.getSampleFlowNodeTime());
|
||||||
|
newBusinessAssayTaskDataDO.setAssayDepartmentId(businessAssayTaskDataDO.getAssayDepartmentId());
|
||||||
|
newBusinessAssayTaskDataDO.setAssayDepartmentName(businessAssayTaskDataDO.getAssayDepartmentName());
|
||||||
|
|
||||||
|
saveBusinessAssayTaskDataDOList.add(newBusinessAssayTaskDataDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查询新的检测项目
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(businessAssayTaskDataDO.getConfigAssayMethodId());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
assayProjectBuilder.append(configAssayMethodProjectDO.getShowName()).append(",");
|
||||||
|
|
||||||
|
//检测项目
|
||||||
|
BusinessAssayProjectDataDO businessAssayProjectDataDO = new BusinessAssayProjectDataDO();
|
||||||
|
businessAssayProjectDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayProjectDataDO.setBusinessAssayTaskDataId(businessAssayTaskDataDO.getId());
|
||||||
|
businessAssayProjectDataDO.setConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||||
|
businessAssayProjectDataDO.setDictionaryProjectId(configAssayMethodProjectDO.getDictionaryProjectId());
|
||||||
|
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||||
|
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||||
|
businessAssayProjectDataDO.setIsEnabled(1);
|
||||||
|
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||||
|
|
||||||
|
saveBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodProjectDO.getId());
|
||||||
|
for (ConfigAssayMethodProjectParameterDO configAssayMethodProjectParameterDO : configAssayMethodProjectParameterDOList) {
|
||||||
|
BusinessAssayParameterDataDO businessAssayParameterDataDO = new BusinessAssayParameterDataDO();
|
||||||
|
businessAssayParameterDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayParameterDataDO.setConfigAssayMethodProjectParameterId(configAssayMethodProjectParameterDO.getId());
|
||||||
|
businessAssayParameterDataDO.setBusinessAssayProjectDataId(businessAssayProjectDataDO.getId());
|
||||||
|
businessAssayParameterDataDO.setDictionaryParameterId(configAssayMethodProjectParameterDO.getDictionaryParameterId());
|
||||||
|
businessAssayParameterDataDO.setDataType(configAssayMethodProjectParameterDO.getDataType());
|
||||||
|
businessAssayParameterDataDO.setDecimalPosition(configAssayMethodProjectParameterDO.getDecimalPosition());
|
||||||
|
|
||||||
|
|
||||||
|
saveBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
businessAssayTaskDataMapper.updateBatch(businessAssayTaskDataDOList);
|
||||||
|
businessAssayProjectDataMapper.deleteByIds(removeProjectIdList);
|
||||||
|
businessAssayParameterDataMapper.deleteByIds(removeParameterIdList);
|
||||||
|
//更新报表数据来源
|
||||||
|
if (updateBusinessAssayReportDataDOList.size() > 0) {
|
||||||
|
businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList);
|
||||||
|
}
|
||||||
|
if (saveBusinessAssayTaskDataDOList.size() > 0) {
|
||||||
|
businessAssayTaskDataMapper.insertBatch(saveBusinessAssayTaskDataDOList);
|
||||||
|
}
|
||||||
|
if (saveBusinessAssayProjectDataDOList.size() > 0) {
|
||||||
|
businessAssayProjectDataMapper.insertBatch(saveBusinessAssayProjectDataDOList);
|
||||||
|
}
|
||||||
|
if (saveBusinessAssayParameterDataDOList.size() > 0) {
|
||||||
|
businessAssayParameterDataMapper.insertBatch(saveBusinessAssayParameterDataDOList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) {
|
public LiteflowResponse methodAssign(SampleTaskAssignMethodParam param) {
|
||||||
if (param.getConfigAssayMethodId() == null) {
|
if (param.getConfigAssayMethodId() == null) {
|
||||||
throw new ServiceException(500, "无分析方法");
|
throw new ServiceException(1_032_100_000, "无分析方法");
|
||||||
}
|
}
|
||||||
if (CollUtil.isEmpty(param.getAssignAssayUserList())) {
|
if (CollUtil.isEmpty(param.getAssignAssayUserList())) {
|
||||||
throw new ServiceException(500, "无任务分配人员");
|
throw new ServiceException(1_032_100_000, "无任务分配人员");
|
||||||
}
|
}
|
||||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("按方法分配任务失败", response.getCause());
|
log.error("按方法分配任务失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -102,16 +348,16 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public LiteflowResponse sampleAssign(SampleTaskAssignSampleParam param) {
|
public LiteflowResponse sampleAssign(SampleTaskAssignSampleParam param) {
|
||||||
if (param.getAssignAssayUser() == null) {
|
if (param.getAssignAssayUser() == null) {
|
||||||
throw new ServiceException(500, "无任务分配人员");
|
throw new ServiceException(1_032_100_000, "无任务分配人员");
|
||||||
}
|
}
|
||||||
if (CollUtil.isEmpty(param.getAssignSampleIdList())) {
|
if (CollUtil.isEmpty(param.getAssignSampleIdList())) {
|
||||||
throw new ServiceException(500, "无任务分配样品");
|
throw new ServiceException(1_032_100_000, "无任务分配样品");
|
||||||
}
|
}
|
||||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("按样品分配任务失败", response.getCause());
|
log.error("按样品分配任务失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -120,16 +366,16 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public LiteflowResponse manualAssign(SampleTaskAssignManualParam param) {
|
public LiteflowResponse manualAssign(SampleTaskAssignManualParam param) {
|
||||||
if (param.getAssignAssayUser() == null) {
|
if (param.getAssignAssayUser() == null) {
|
||||||
throw new ServiceException(500, "无任务分配人员");
|
throw new ServiceException(1_032_100_000, "无任务分配人员");
|
||||||
}
|
}
|
||||||
if (CollUtil.isEmpty(param.getAssayTaskDataIdList())) {
|
if (CollUtil.isEmpty(param.getAssayTaskDataIdList())) {
|
||||||
throw new ServiceException(500, "无分配的检测任务");
|
throw new ServiceException(1_032_100_000, "无分配的检测任务");
|
||||||
}
|
}
|
||||||
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
Long tenantId = TenantContextHolder.getRequiredTenantId();
|
||||||
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
LiteflowResponse response = flowExecutor.execute2Resp("sampleTaskAssignChain" + tenantId, param, SampleTaskAssignContext.class);
|
||||||
if (!response.isSuccess()){
|
if (!response.isSuccess()){
|
||||||
log.error("手动分配任务失败", response.getCause());
|
log.error("手动分配任务失败", response.getCause());
|
||||||
throw new ServiceException(500, response.getCause().getMessage());
|
throw new ServiceException(1_032_100_000, response.getCause().getMessage());
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -148,7 +394,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
public void voidAssign(Long id) {
|
public void voidAssign(Long id) {
|
||||||
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(id);
|
BusinessAssayTaskDO businessAssayTaskDO = businessAssayTaskMapper.selectById(id);
|
||||||
if (QmsCommonConstant.SUBMITTED.equals(businessAssayTaskDO.getTaskAssignStatus())) {
|
if (QmsCommonConstant.SUBMITTED.equals(businessAssayTaskDO.getTaskAssignStatus())) {
|
||||||
throw new ServiceException(500, "任务已提交,不允许作废");
|
throw new ServiceException(1_032_100_000, "任务已提交,不允许作废");
|
||||||
}
|
}
|
||||||
businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.VOID);
|
businessAssayTaskDO.setTaskAssignStatus(QmsCommonConstant.VOID);
|
||||||
|
|
||||||
@@ -163,6 +409,7 @@ public class SampleTaskAssignServiceImpl implements SampleTaskAssignService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void removeAssignTaskDetail(BatchDeleteReqVO req) {
|
public void removeAssignTaskDetail(BatchDeleteReqVO req) {
|
||||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailDOList = businessAssayTaskDetailMapper.selectByIds(req.getIds());
|
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailDOList = businessAssayTaskDetailMapper.selectByIds(req.getIds());
|
||||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDetailDOList.stream().map(m -> m.getBusinessAssayTaskDataId()).collect(Collectors.toList());
|
List<Long> businessAssayTaskDataIdList = businessAssayTaskDetailDOList.stream().map(m -> m.getBusinessAssayTaskDataId()).collect(Collectors.toList());
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ public class ConfigReportTemplateController implements BusinessControllerMarker
|
|||||||
log.error("生成base64图片失败", e);
|
log.error("生成base64图片失败", e);
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(imgBase64)) {
|
if (StringUtils.isBlank(imgBase64)) {
|
||||||
return CommonResult.error(500, "生成Base64图片失败");
|
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||||
}
|
}
|
||||||
return success(imgBase64);
|
return success(imgBase64);
|
||||||
}
|
}
|
||||||
@@ -535,7 +535,7 @@ public class ConfigReportTemplateController implements BusinessControllerMarker
|
|||||||
log.error("生成base64图片失败", e);
|
log.error("生成base64图片失败", e);
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(imgBase64)) {
|
if (StringUtils.isBlank(imgBase64)) {
|
||||||
return CommonResult.error(500, "生成Base64图片失败");
|
return CommonResult.error(1_032_100_000, "生成Base64图片失败");
|
||||||
}
|
}
|
||||||
return success(imgBase64);
|
return success(imgBase64);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ConfigSubSampleMethodExtendRespVO extends ConfigSubSampleMethodRespVO {
|
||||||
|
|
||||||
|
/** 分析方法名称 **/
|
||||||
|
@Schema(description = "分析方法名称")
|
||||||
|
private String configAssayMethodName;
|
||||||
|
|
||||||
|
/** 分析方法编号 **/
|
||||||
|
@Schema(description = "分析方法编号")
|
||||||
|
private String configAssayMethodCode;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目")
|
||||||
|
private String assayProject;
|
||||||
|
}
|
||||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectParameterPageReqVO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,4 +37,9 @@ public interface ConfigAssayMethodProjectParameterMapper extends BaseMapperX<Con
|
|||||||
.orderByDesc(ConfigAssayMethodProjectParameterDO::getId));
|
.orderByDesc(ConfigAssayMethodProjectParameterDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigAssayMethodProjectParameterDO> selectByConfigAssayMethodProjectId(Long configAssayMethodProjectId) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<ConfigAssayMethodProjectParameterDO>()
|
||||||
|
.eq(ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId, configAssayMethodProjectId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,10 +2,15 @@ package com.zt.plat.module.qms.business.config.dal.mapper;
|
|||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
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.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,4 +33,14 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
|||||||
.orderByDesc(ConfigSubSampleMethodDO::getId));
|
.orderByDesc(ConfigSubSampleMethodDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigSubSampleMethodExtendRespVO> selectByConfigSubSampleIdAndAssayDepartmentId(Long configSubSampleId, Long assayDepartmentId) {
|
||||||
|
return selectJoinList(ConfigSubSampleMethodExtendRespVO.class, new MPJLambdaWrapperX<ConfigSubSampleMethodDO>()
|
||||||
|
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, ConfigSubSampleMethodDO::getConfigAssayMethodId)
|
||||||
|
.selectAll(ConfigSubSampleMethodDO.class)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getName, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodName)
|
||||||
|
.selectAs(ConfigAssayMethodDO::getMethodCode, ConfigSubSampleMethodExtendRespVO::getConfigAssayMethodCode)
|
||||||
|
.eq(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleId)
|
||||||
|
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public class SequenceUtil {
|
|||||||
*/
|
*/
|
||||||
public String genCode(String sequenceCode) {
|
public String genCode(String sequenceCode) {
|
||||||
if (sequenceApi == null) {
|
if (sequenceApi == null) {
|
||||||
throw new ServiceException(500, "序列号服务为空");
|
throw new ServiceException(1_032_100_000, "序列号服务为空");
|
||||||
}
|
}
|
||||||
String circulationValue = null;
|
String circulationValue = null;
|
||||||
List<String> inputStrs = null;
|
List<String> inputStrs = null;
|
||||||
@@ -40,7 +40,7 @@ public class SequenceUtil {
|
|||||||
if (result != null && result.isSuccess() && result.getData() != null) {
|
if (result != null && result.isSuccess() && result.getData() != null) {
|
||||||
return result.getData();
|
return result.getData();
|
||||||
}
|
}
|
||||||
throw new ServiceException(500, "调用远程服务获取序列号异常");
|
throw new ServiceException(1_032_100_000, "调用远程服务获取序列号异常");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,4 +52,38 @@
|
|||||||
tcam.NAME
|
tcam.NAME
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectUnAssignTaskedSubSample" resultType="com.zt.plat.module.qms.business.bus.controller.vo.UnAssignTaskedSubSampleRespVO">
|
||||||
|
SELECT
|
||||||
|
tbss.ID || ',' || tbatd.CFG_ASY_MTHD_ID AS id ,
|
||||||
|
tbss.SMP_NAME AS sampleName,
|
||||||
|
tbss.SMP_CD AS sampleCode,
|
||||||
|
tbss.SMP_ASY_CD AS sampleAssayCode,
|
||||||
|
tbss.SMP_RTN_CD AS sampleReturnCode,
|
||||||
|
tbss.SMP_FLW_NDE_TM AS sampleFlowNodeTime,
|
||||||
|
tbatd.BSN_SB_SMP_ID AS businessSubSampleId,
|
||||||
|
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||||
|
tbatd.ASY_TP AS assayType,
|
||||||
|
tbatd.ASY_PRJ AS assayProject,
|
||||||
|
tbatd.ASY_DEPT_ID AS assayDepartmentId,
|
||||||
|
tbatd.ASY_DEPT_NAME AS assayDepartmentName
|
||||||
|
FROM
|
||||||
|
T_BSN_ASY_TSK_DAT tbatd
|
||||||
|
LEFT JOIN T_BSN_SB_SMP tbss ON
|
||||||
|
tbatd.BSN_SB_SMP_ID = tbss.ID
|
||||||
|
WHERE tbatd.IS_ASN_TSKD = 0
|
||||||
|
AND tbatd.SMP_FLW_NDE_KY = 'flw_fx_receive'
|
||||||
|
GROUP BY tbss.ID ,
|
||||||
|
tbss.SMP_NAME ,
|
||||||
|
tbss.SMP_CD ,
|
||||||
|
tbss.SMP_ASY_CD ,
|
||||||
|
tbss.SMP_RTN_CD ,
|
||||||
|
tbss.SMP_FLW_NDE_TM,
|
||||||
|
tbatd.BSN_SB_SMP_ID ,
|
||||||
|
tbatd.CFG_ASY_MTHD_ID ,
|
||||||
|
tbatd.ASY_TP ,
|
||||||
|
tbatd.ASY_PRJ,
|
||||||
|
tbatd.ASY_DEPT_ID,
|
||||||
|
tbatd.ASY_DEPT_NAME
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user