检验委托任务添加修改
This commit is contained in:
@@ -31,12 +31,6 @@ public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||
@Resource
|
||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||
|
||||
@GetMapping("/crossAuditByTaskId")
|
||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 交叉审核
|
||||
* @return
|
||||
|
||||
@@ -60,14 +60,6 @@ public class SampleEntrustController implements BusinessControllerMarker {
|
||||
return success(sampleEntrustRegistration);
|
||||
}
|
||||
|
||||
@GetMapping("/reportDetail")
|
||||
@Operation(summary = "委托单详情数据")
|
||||
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
||||
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
||||
return success(jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改委托登记")
|
||||
public CommonResult<?> update(@Valid @RequestBody SampleEntrustParam sampleEntrustParam) {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleEntrustService;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 报表数据查询接口,不继承BusinessControllerMarker
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/reporting-data-query")
|
||||
public class SampleReportDataQueryController {
|
||||
|
||||
@Resource
|
||||
private SampleEntrustService sampleEntrustService;
|
||||
|
||||
@Resource
|
||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||
|
||||
@GetMapping("/entrust-report-detail")
|
||||
@Operation(summary = "委托单详情数据")
|
||||
public CommonResult<?> reportDetail(@RequestParam("id") Long id) {
|
||||
JSONObject jsonObject = sampleEntrustService.reportDetail(id);
|
||||
return success(jsonObject);
|
||||
|
||||
}
|
||||
|
||||
@Operation(summary = "委托单详情数据")
|
||||
@GetMapping("/crossAuditByTaskId")
|
||||
public CommonResult<?> crossAuditByTaskId(Long businessAssayTaskId) {
|
||||
JSONObject result = sampleAnalysisAuditService.crossAuditByTaskId(businessAssayTaskId);
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
@@ -90,13 +90,16 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX<BusinessS
|
||||
/**
|
||||
* 查询当前批次的第一条数据
|
||||
* @param businessBaseSampleId 任意一条的主样id
|
||||
* @param baseSampleDictionaryBusinessKey 样品大类类型key
|
||||
* @return
|
||||
*/
|
||||
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleIdAndBaseSampleDictionaryBusinessKey(Long businessBaseSampleId, String baseSampleDictionaryBusinessKey) {
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = selectByBusinessBaseSampleId(businessBaseSampleId);
|
||||
//查询当前委托的第一条
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>()
|
||||
return selectJoinOne(BusinessSampleEntrustDetailDO.class, new MPJLambdaWrapperX<BusinessSampleEntrustDetailDO>()
|
||||
.leftJoin(BaseSampleDO.class, BaseSampleDO::getId, BusinessSampleEntrustDetailDO::getBaseSampleId)
|
||||
.eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustDetailDO.getBusinessSampleEntrustRegistrationId())
|
||||
.eq(BaseSampleDO::getDictionaryBusinessKey, baseSampleDictionaryBusinessKey)
|
||||
.orderByAsc(BusinessSampleEntrustDetailDO::getSort)
|
||||
.last(" limit 1 "));
|
||||
|
||||
|
||||
@@ -4,8 +4,10 @@ import java.util.*;
|
||||
|
||||
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.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -48,4 +50,12 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds,
|
||||
Long assayDepartmentId) {
|
||||
return selectJoinList(BusinessSubParentSampleAssessmentDO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId)
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(ConfigAssayMethodDO::getAssayDepartmentId, assayDepartmentId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,6 +46,12 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
|
||||
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubParentSampleIdsAndAssayDepartmentId(List<Long> businessSubParentSampleIds, Long assayDepartmentId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, assayDepartmentId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleId(Long businessSubSampleId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleId));
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -433,7 +433,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
|
||||
|
||||
List<BusinessSubSampleDO> updateBusinessSubSampleDOList = new ArrayList<>();
|
||||
List<BusinessSubSampleAnalysisGroupDO> updateBusinessSubSampleAnalysisGroupDOList = new ArrayList<>();
|
||||
|
||||
@@ -444,8 +443,6 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
|
||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||
|
||||
// List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
|
||||
//循环分样主样数据
|
||||
for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) {
|
||||
|
||||
@@ -538,8 +535,9 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
//处理子样分析任务数据
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
List<Long> businessSubSampleIdList = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIds(reqVO.getBusinessSubParentSampleIds());
|
||||
@@ -566,6 +564,26 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
|
||||
|
||||
}
|
||||
**/
|
||||
//分析方法信息
|
||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(reqVO.getConfigAssayMethodId());
|
||||
//查询当前分析部门下的分样判定信息
|
||||
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId());
|
||||
//查询当前分析部门下的子样分析班组信息
|
||||
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubParentSampleIdsAndAssayDepartmentId(reqVO.getBusinessSubParentSampleIds(), configAssayMethodDO.getAssayDepartmentId());
|
||||
for (BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO : businessSubSampleAnalysisGroupDOList) {//循环分析班组信息
|
||||
//查询当前分样判定上报未上报的,并排除当前上报的方法,的数量
|
||||
long count = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubSampleAnalysisGroupDO.getBusinessSubParentSampleId()) && !f.getConfigAssayMethodId().equals(reqVO.getConfigAssayMethodId()) && f.getIsReported().equals(QmsCommonConstant.NO)).count();
|
||||
if (count > 0) {//如果还存在未上报的数据,则继续
|
||||
continue;
|
||||
}
|
||||
businessSubSampleAnalysisGroupDO.setSampleStatus("已完成");//当前班组分析已完成
|
||||
updateBusinessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||
//查询子样
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleMapper.selectById(businessSubSampleAnalysisGroupDO.getBusinessSubSampleId());
|
||||
updateBusinessSubSampleDOList.add(businessSubSampleDO);
|
||||
}
|
||||
|
||||
|
||||
if (saveBusinessAssayReportDataDOList.size() > 0) {
|
||||
businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user