Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleParentRecheckService;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 分样复检业务数据")
|
||||
@RestController
|
||||
@RequestMapping("/qms/business-sub-sample-parent-recheck")
|
||||
@Validated
|
||||
public class BusinessSubSampleParentRecheckController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleParentRecheckService businessSubSampleParentRecheckService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分样复检业务数据")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:create')")
|
||||
public CommonResult<BusinessSubSampleParentRecheckRespVO> createBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO createReqVO) {
|
||||
return success(businessSubSampleParentRecheckService.createBusinessSubSampleParentRecheck(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分样复检业务数据")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:update')")
|
||||
public CommonResult<Boolean> updateBusinessSubSampleParentRecheck(@Valid @RequestBody BusinessSubSampleParentRecheckSaveReqVO updateReqVO) {
|
||||
businessSubSampleParentRecheckService.updateBusinessSubSampleParentRecheck(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分样复检业务数据")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessSubSampleParentRecheck(@RequestParam("id") Long id) {
|
||||
businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheck(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除分样复检业务数据")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessSubSampleParentRecheckList(@RequestBody BatchDeleteReqVO req) {
|
||||
businessSubSampleParentRecheckService.deleteBusinessSubSampleParentRecheckListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分样复检业务数据")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')")
|
||||
public CommonResult<BusinessSubSampleParentRecheckRespVO> getBusinessSubSampleParentRecheck(@RequestParam("id") Long id) {
|
||||
BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheck(id);
|
||||
return success(BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分样复检业务数据分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:query')")
|
||||
public CommonResult<PageResult<BusinessSubSampleParentRecheckRespVO>> getBusinessSubSampleParentRecheckPage(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO) {
|
||||
PageResult<BusinessSubSampleParentRecheckDO> pageResult = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessSubSampleParentRecheckRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分样复检业务数据 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-sample-parent-recheck:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBusinessSubSampleParentRecheckExcel(@Valid BusinessSubSampleParentRecheckPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BusinessSubSampleParentRecheckDO> list = businessSubSampleParentRecheckService.getBusinessSubSampleParentRecheckPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分样复检业务数据.xls", "数据", BusinessSubSampleParentRecheckRespVO.class,
|
||||
BeanUtils.toBean(list, BusinessSubSampleParentRecheckRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,9 +18,6 @@ import jakarta.annotation.Resource;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 分析审核
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
/**
|
||||
* 结果上报
|
||||
*/
|
||||
@Tag(name = "管理后台 - 结果上报")
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/result-reporting")
|
||||
@Validated
|
||||
public class SampleResultReportingController {
|
||||
|
||||
@Resource
|
||||
private SampleResultReportingService sampleResultReportingService;
|
||||
|
||||
//获取未上报的方法
|
||||
@GetMapping("/getUnReportMethodGroupList")
|
||||
public CommonResult<?> getUnReportMethodGroupList() {
|
||||
List<BusinessSubParentSampleAssessmentGroupRespVO> list = sampleResultReportingService.getUnReportMethodGroupList();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
//获取方法对应的样品
|
||||
@GetMapping("/getSampleResultReportingList")
|
||||
public CommonResult<?> getSampleResultReportingList(Long configAssayMethodId) {
|
||||
JSONObject result = sampleResultReportingService.getSampleResultReportingList(configAssayMethodId);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
//获取复检方法
|
||||
@GetMapping("/getRecheckAssayMethodList")
|
||||
public CommonResult<?> getRecheckMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
List<RecheckSubSampleParentMethodRespVO> list = sampleResultReportingService.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
//创建复检样
|
||||
@PostMapping("/createRecheckSample")
|
||||
public CommonResult<?> createRecheckSample(@RequestBody RecheckSubSampleParentCreateReqVO reqVO) {
|
||||
sampleResultReportingService.createRecheckSample(reqVO);
|
||||
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//上报
|
||||
@PostMapping("/batchResultDataReporting")
|
||||
public CommonResult<?> batchResultDataReporting(@RequestBody BatchResultDataReportingReqVO reqVO) {
|
||||
sampleResultReportingService.batchResultDataReporting(reqVO);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
//结果单个结果查询
|
||||
@GetMapping("/getSingleSampleResultReportingList")
|
||||
public CommonResult<?> getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
JSONObject result = sampleResultReportingService.getSingleSampleResultReportingList(businessSubParentSampleId, configAssayMethodId);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
//修改结果
|
||||
@PostMapping("/modifySampleResultReporting")
|
||||
public CommonResult<?> modifySampleResultReporting(@RequestBody ModifySampleResultReportingReqVO reqVO) {
|
||||
sampleResultReportingService.modifySampleResultReporting(reqVO);
|
||||
return success("成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BatchResultDataReportingReqVO {
|
||||
|
||||
private List<Long> businessSubParentSampleIds;
|
||||
|
||||
private Long configAssayMethodId;
|
||||
}
|
||||
@@ -2,18 +2,6 @@ package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <b>BusinessAssayTaskDataGroupRespVO</b>
|
||||
* <p>
|
||||
* 更新历史:
|
||||
* <pre> 版本 更新时间 更新者 更新内容<hr/>
|
||||
* V1.0 2025年9月20日 wxr Add</pre>
|
||||
* <b>Copyright (C) 云南志者竟成科技有限公司</b>
|
||||
* </p>
|
||||
* @author 王兴荣<wxr@wangxingrong.com>
|
||||
* @version V1.0
|
||||
* @since 2025年9月20日
|
||||
*/
|
||||
@Data
|
||||
public class BusinessAssayTaskDataGroupRespVO {
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinessSubParentSampleAssessmentExtendRespVO extends BusinessSubParentSampleAssessmentRespVO {
|
||||
|
||||
@Schema(description = "检测项目key")
|
||||
private String dictionaryProjectKey;
|
||||
|
||||
@Schema(description = "检测项目单位")
|
||||
private String dictionaryProjectUnit;
|
||||
|
||||
@Schema(description = "检测项目缩写")
|
||||
private String simpleName;
|
||||
|
||||
@Schema(description = "显示名称")
|
||||
private String showName;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BusinessSubParentSampleAssessmentGroupRespVO {
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
private String configAssayMethodName;
|
||||
|
||||
private Integer sampleCount;
|
||||
}
|
||||
@@ -25,6 +25,12 @@ public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam {
|
||||
@Schema(description = "检测方法配置ID", example = "16271")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1")
|
||||
private String assayType;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@@ -34,9 +40,6 @@ public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam {
|
||||
@Schema(description = "判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", example = "张三")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2")
|
||||
private String assessmentStatus;
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ public class BusinessSubParentSampleAssessmentRespVO {
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1")
|
||||
private String assayType;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间")
|
||||
private String dataType;
|
||||
@@ -44,10 +50,6 @@ public class BusinessSubParentSampleAssessmentRespVO {
|
||||
@ExcelProperty("判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("上报对应列")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差")
|
||||
private String assessmentStatus;
|
||||
|
||||
@@ -30,6 +30,12 @@ public class BusinessSubParentSampleAssessmentSaveReqVO {
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "任务类型,【字典】【jy_sample_task_type】常规、抽查...", example = "2")
|
||||
private String taskType;
|
||||
|
||||
@Schema(description = "分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...", example = "1")
|
||||
private String assayType;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空")
|
||||
private String dataType;
|
||||
@@ -40,10 +46,6 @@ public class BusinessSubParentSampleAssessmentSaveReqVO {
|
||||
@Schema(description = "判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "上报对应列不能为空")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差不能为空")
|
||||
private String assessmentStatus;
|
||||
|
||||
@@ -6,6 +6,10 @@ import lombok.Data;
|
||||
@Data
|
||||
public class BusinessSubSampleAssessmentExtendRespVO extends BusinessSubSampleAssessmentRespVO {
|
||||
|
||||
/** 分析方法名称 **/
|
||||
@Schema(description = "分析方法名称")
|
||||
private String configAssayMethodName;
|
||||
|
||||
@Schema(description = "检测项目key")
|
||||
private String dictionaryProjectKey;
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@Data
|
||||
public class BusinessSubSampleAssessmentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分样id")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "分样子样ID", example = "7025")
|
||||
private Long businessSubSampleId;
|
||||
|
||||
|
||||
@@ -15,6 +15,9 @@ public class BusinessSubSampleAssessmentRespVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分样id")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025")
|
||||
@ExcelProperty("分样子样ID")
|
||||
|
||||
@@ -13,6 +13,9 @@ public class BusinessSubSampleAssessmentSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23478")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分样id")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "分样子样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7025")
|
||||
@NotNull(message = "分样子样ID不能为空")
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 分样复检业务数据分页 Request VO")
|
||||
@Data
|
||||
public class BusinessSubSampleParentRecheckPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "样品ID", example = "19065")
|
||||
private Long sampleId;
|
||||
|
||||
@Schema(description = "样品主样ID", example = "26605")
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
@Schema(description = "样品分样ID", example = "29386")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", example = "19087")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "复检样品主样ID", example = "12742")
|
||||
private Long recheckBusinessBaseSampleId;
|
||||
|
||||
@Schema(description = "复检样品分样ID", example = "24043")
|
||||
private Long recheckBusinessSubParentSampleId;
|
||||
|
||||
@Schema(description = "复检检测方法配置ID", example = "4026")
|
||||
private Long recheckConfigAssayMethodId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "乐观锁", example = "18382")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分样复检业务数据 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusinessSubSampleParentRecheckRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "样品ID", example = "19065")
|
||||
@ExcelProperty("样品ID")
|
||||
private Long sampleId;
|
||||
|
||||
@Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605")
|
||||
@ExcelProperty("样品主样ID")
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386")
|
||||
@ExcelProperty("样品分样ID")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087")
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742")
|
||||
@ExcelProperty("复检样品主样ID")
|
||||
private Long recheckBusinessBaseSampleId;
|
||||
|
||||
@Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043")
|
||||
@ExcelProperty("复检样品分样ID")
|
||||
private Long recheckBusinessSubParentSampleId;
|
||||
|
||||
@Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026")
|
||||
@ExcelProperty("复检检测方法配置ID")
|
||||
private Long recheckConfigAssayMethodId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382")
|
||||
@ExcelProperty("乐观锁")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分样复检业务数据新增/修改 Request VO")
|
||||
@Data
|
||||
public class BusinessSubSampleParentRecheckSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4631")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "样品ID", example = "19065")
|
||||
private Long sampleId;
|
||||
|
||||
@Schema(description = "样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "26605")
|
||||
@NotNull(message = "样品主样ID不能为空")
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29386")
|
||||
@NotNull(message = "样品分样ID不能为空")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19087")
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "复检样品主样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12742")
|
||||
@NotNull(message = "复检样品主样ID不能为空")
|
||||
private Long recheckBusinessBaseSampleId;
|
||||
|
||||
@Schema(description = "复检样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24043")
|
||||
@NotNull(message = "复检样品分样ID不能为空")
|
||||
private Long recheckBusinessSubParentSampleId;
|
||||
|
||||
@Schema(description = "复检检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "4026")
|
||||
@NotNull(message = "复检检测方法配置ID不能为空")
|
||||
private Long recheckConfigAssayMethodId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "18382")
|
||||
@NotNull(message = "乐观锁不能为空")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ModifySampleResultReportingReqVO {
|
||||
|
||||
private String businessSubParentSampleAssessmentIds;
|
||||
|
||||
private String businessSubSampleAssessmentIds;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NoReportSubParentSampleAssessmentRespVO {
|
||||
|
||||
private Long baseSampleId;
|
||||
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
private Long configBaseSampleId;
|
||||
|
||||
private Long configSubSampleParentId;
|
||||
|
||||
private String sampleName;
|
||||
|
||||
private String baseSampleName;
|
||||
|
||||
private String taskType;
|
||||
|
||||
private String assayType;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RecheckSubSampleParentCreateReqVO {
|
||||
|
||||
private String sampleCode;
|
||||
|
||||
private String sampleName;
|
||||
|
||||
private Long baseSampleId;
|
||||
|
||||
private Long businessBaseSampleId;
|
||||
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
private Long businessSubSampleId;
|
||||
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
List<RecheckSubSampleParentMethodRespVO> recheckProjectList;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RecheckSubSampleParentMethodRespVO {
|
||||
|
||||
private Long dictionaryProjectId;
|
||||
|
||||
private String dictionaryProjectName;
|
||||
|
||||
private String dictionaryProjectSimpleName;
|
||||
|
||||
private String dictionaryProjectShowName;
|
||||
|
||||
private Long configAssayMethodId;
|
||||
|
||||
private String configAssayMethodName;
|
||||
|
||||
private Long baseSampleId;
|
||||
|
||||
private String baseSampleName;
|
||||
|
||||
private Integer isRecheckDefault;
|
||||
|
||||
private List<ConfigAssayMethodRespVO> methodList;
|
||||
}
|
||||
@@ -53,6 +53,16 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO {
|
||||
@TableField("CFG_ASY_MTHD_ID")
|
||||
private Long configAssayMethodId;
|
||||
/**
|
||||
* 任务类型,【字典】【jy_sample_task_type】常规、抽查...
|
||||
*/
|
||||
@TableField("TSK_TP")
|
||||
private String taskType;
|
||||
/**
|
||||
* 分析类型,【字典】【jy_sample_assay_type】单杯-single_cup、双杯-double_cup、平行-single_parallel...
|
||||
*/
|
||||
@TableField("ASY_TP")
|
||||
private String assayType;
|
||||
/**
|
||||
* 数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
@@ -68,11 +78,6 @@ public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO {
|
||||
@TableField("ASMT_VAL")
|
||||
private String assessmentValue;
|
||||
/**
|
||||
* 上报对应列
|
||||
*/
|
||||
@TableField("COLN_NAME")
|
||||
private String columnName;
|
||||
/**
|
||||
* 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差
|
||||
*/
|
||||
@TableField("ASMT_STS")
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.zt.plat.module.qms.business.bus.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 分样复检业务数据 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_bsn_sb_smp_prn_rchk")
|
||||
@KeySequence("t_bsn_sb_smp_prn_rchk_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class BusinessSubSampleParentRecheckDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 样品ID
|
||||
*/
|
||||
@TableField("SMP_ID")
|
||||
private Long sampleId;
|
||||
/**
|
||||
* 样品主样ID
|
||||
*/
|
||||
@TableField("BSN_BSE_SMP_ID")
|
||||
private Long businessBaseSampleId;
|
||||
/**
|
||||
* 样品分样ID
|
||||
*/
|
||||
@TableField("BSN_SB_PRN_SMP_ID")
|
||||
private Long businessSubParentSampleId;
|
||||
/**
|
||||
* 检测方法配置ID
|
||||
*/
|
||||
@TableField("CFG_ASY_MTHD_ID")
|
||||
private Long configAssayMethodId;
|
||||
/**
|
||||
* 复检样品主样ID
|
||||
*/
|
||||
@TableField("RCHK_BSN_BSE_SMP_ID")
|
||||
private Long recheckBusinessBaseSampleId;
|
||||
/**
|
||||
* 复检样品分样ID
|
||||
*/
|
||||
@TableField("RCHK_BSN_SB_PRN_SMP_ID")
|
||||
private Long recheckBusinessSubParentSampleId;
|
||||
/**
|
||||
* 复检检测方法配置ID
|
||||
*/
|
||||
@TableField("RCHK_CFG_ASY_MTHD_ID")
|
||||
private Long recheckConfigAssayMethodId;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 乐观锁
|
||||
*/
|
||||
@TableField("UPD_CNT")
|
||||
private Integer updateCount;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -230,6 +230,18 @@ public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTa
|
||||
.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleId)
|
||||
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分样查询分析任务
|
||||
* @param businessSubParentSampleIds 分样样id
|
||||
* @param configAssayMethodId 分析方法
|
||||
* @return
|
||||
*/
|
||||
default List<BusinessAssayTaskDataDO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>()
|
||||
.in(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询是否上报的分析任务
|
||||
|
||||
@@ -2,12 +2,17 @@ package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.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.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 班组判定数据业务 Mapper
|
||||
@@ -17,16 +22,19 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
@Mapper
|
||||
public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<BusinessSubParentSampleAssessmentDO> {
|
||||
|
||||
List<BusinessSubParentSampleAssessmentGroupRespVO> selectUnReportMethodGroupList();
|
||||
|
||||
default PageResult<BusinessSubParentSampleAssessmentDO> selectPage(BusinessSubParentSampleAssessmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssayType, reqVO.getAssayType())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue())
|
||||
.likeIfPresent(BusinessSubParentSampleAssessmentDO::getColumnName, reqVO.getColumnName())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getIsReported, reqVO.getIsReported())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getReporter, reqVO.getReporter())
|
||||
@@ -37,5 +45,28 @@ public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<Bus
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessSubParentSampleAssessmentDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentExtendRespVO> selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubParentSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentDO::getDictionaryProjectId)
|
||||
.selectAll(BusinessSubParentSampleAssessmentDO.class)
|
||||
.selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName)
|
||||
.selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName)
|
||||
.in(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentDO> selectByConfigAssayMethodId(Long configAssayMethodId) {
|
||||
return selectList(new LambdaQueryWrapper<BusinessSubParentSampleAssessmentDO>()
|
||||
.eq(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
List<NoReportSubParentSampleAssessmentRespVO> selectNoReportSubParentSampleAssessment(@Param("configAssayMethodId") Long configAssayMethodId);
|
||||
|
||||
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(@Param("baseSampleId") Long baseSampleId, @Param("businessSubParentSampleId") Long businessSubParentSampleId, @Param("configAssayMethodId") Long configAssayMethodId);
|
||||
|
||||
|
||||
}
|
||||
@@ -4,15 +4,17 @@ 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.controller.vo.BusinessSubSampleAssessmentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 子样判定数据业务 Mapper
|
||||
@@ -24,6 +26,7 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX<BusinessS
|
||||
|
||||
default PageResult<BusinessSubSampleAssessmentDO> selectPage(BusinessSubSampleAssessmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessSubSampleAssessmentDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||
.eqIfPresent(BusinessSubSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
.eqIfPresent(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
@@ -44,6 +47,36 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX<BusinessS
|
||||
.orderByDesc(BusinessSubSampleAssessmentDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAssessmentExtendRespVO> selectByBusinessSubParentSampleIdAndConfigAssayMethodId(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId)
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId)
|
||||
.selectAll(BusinessSubSampleAssessmentDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName)
|
||||
.selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName)
|
||||
.eq(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleId)
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAssessmentExtendRespVO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodId)
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubSampleAssessmentDO::getDictionaryProjectId)
|
||||
.selectAll(BusinessSubSampleAssessmentDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessSubSampleAssessmentExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(ConfigAssayMethodProjectDO::getDictionaryProjectUnit, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectUnit)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessSubSampleAssessmentExtendRespVO::getDictionaryProjectKey)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessSubSampleAssessmentExtendRespVO::getSimpleName)
|
||||
.selectAs(DictionaryProjectDO::getShowName, BusinessSubSampleAssessmentExtendRespVO::getShowName)
|
||||
.in(BusinessSubSampleAssessmentDO::getBusinessSubParentSampleId, businessSubParentSampleIds)
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleAssessmentExtendRespVO> selectByBusinessSubSampleIdAndConfigAssayMethodId(Long businessSubSampleId, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubSampleAssessmentExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleAssessmentDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId)
|
||||
@@ -64,4 +97,5 @@ public interface BusinessSubSampleAssessmentMapper extends BaseMapperX<BusinessS
|
||||
.eq(BusinessSubSampleAssessmentDO::getConfigAssayMethodProjectId, configAssayMethodProjectId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 分样复检业务数据 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessSubSampleParentRecheckMapper extends BaseMapperX<BusinessSubSampleParentRecheckDO> {
|
||||
|
||||
default PageResult<BusinessSubSampleParentRecheckDO> selectPage(BusinessSubSampleParentRecheckPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubSampleParentRecheckDO>()
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getSampleId, reqVO.getSampleId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessBaseSampleId, reqVO.getRecheckBusinessBaseSampleId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, reqVO.getRecheckBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, reqVO.getRecheckConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessSubSampleParentRecheckDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getUpdateCount, reqVO.getUpdateCount())
|
||||
.eqIfPresent(BusinessSubSampleParentRecheckDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessSubSampleParentRecheckDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubSampleParentRecheckDO> selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(List<Long> recheckBusinessSubParentSampleIds, Long recheckConfigAssayMethodId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubSampleParentRecheckDO>()
|
||||
.in(BusinessSubSampleParentRecheckDO::getRecheckBusinessSubParentSampleId, recheckBusinessSubParentSampleIds)
|
||||
.eq(BusinessSubSampleParentRecheckDO::getRecheckConfigAssayMethodId, recheckConfigAssayMethodId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 分样复检业务数据 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface BusinessSubSampleParentRecheckService {
|
||||
|
||||
/**
|
||||
* 创建分样复检业务数据
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分样复检业务数据
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBusinessSubSampleParentRecheck(@Valid BusinessSubSampleParentRecheckSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分样复检业务数据
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBusinessSubSampleParentRecheck(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除分样复检业务数据
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteBusinessSubSampleParentRecheckListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得分样复检业务数据
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分样复检业务数据
|
||||
*/
|
||||
BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id);
|
||||
|
||||
/**
|
||||
* 获得分样复检业务数据分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分样复检业务数据分页
|
||||
*/
|
||||
PageResult<BusinessSubSampleParentRecheckDO> getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分样复检业务数据 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusinessSubSampleParentRecheckServiceImpl implements BusinessSubSampleParentRecheckService {
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper;
|
||||
|
||||
@Override
|
||||
public BusinessSubSampleParentRecheckRespVO createBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BusinessSubSampleParentRecheckDO businessSubSampleParentRecheck = BeanUtils.toBean(createReqVO, BusinessSubSampleParentRecheckDO.class);
|
||||
businessSubSampleParentRecheckMapper.insert(businessSubSampleParentRecheck);
|
||||
// 返回
|
||||
return BeanUtils.toBean(businessSubSampleParentRecheck, BusinessSubSampleParentRecheckRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusinessSubSampleParentRecheck(BusinessSubSampleParentRecheckSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBusinessSubSampleParentRecheckExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BusinessSubSampleParentRecheckDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubSampleParentRecheckDO.class);
|
||||
businessSubSampleParentRecheckMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessSubSampleParentRecheck(Long id) {
|
||||
// 校验存在
|
||||
validateBusinessSubSampleParentRecheckExists(id);
|
||||
// 删除
|
||||
businessSubSampleParentRecheckMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessSubSampleParentRecheckListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateBusinessSubSampleParentRecheckExists(ids);
|
||||
// 删除
|
||||
businessSubSampleParentRecheckMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateBusinessSubSampleParentRecheckExists(List<Long> ids) {
|
||||
List<BusinessSubSampleParentRecheckDO> list = businessSubSampleParentRecheckMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBusinessSubSampleParentRecheckExists(Long id) {
|
||||
if (businessSubSampleParentRecheckMapper.selectById(id) == null) {
|
||||
throw exception(BUSINESS_SUB_SAMPLE_PARENT_RECHECK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSubSampleParentRecheckDO getBusinessSubSampleParentRecheck(Long id) {
|
||||
return businessSubSampleParentRecheckMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessSubSampleParentRecheckDO> getBusinessSubSampleParentRecheckPage(BusinessSubSampleParentRecheckPageReqVO pageReqVO) {
|
||||
return businessSubSampleParentRecheckMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,6 +33,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDat
|
||||
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.BusinessBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||
@@ -42,6 +44,8 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskDataMappe
|
||||
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.BusinessBaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
@@ -50,6 +54,7 @@ import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigRuleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigProjectMapper;
|
||||
@@ -59,6 +64,7 @@ import com.zt.plat.module.qms.business.config.dal.mapper.ConfigRuleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMethodMapper;
|
||||
import com.zt.plat.module.qms.core.qlexpress.cmp.AllowanceCalculatorComponent;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
@@ -472,6 +478,15 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
|
||||
@Resource
|
||||
private BusinessBaseSampleMapper businessBaseSampleMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleParentMethodMapper configSubSampleParentMethodMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleMapper businessSubParentSampleMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -484,6 +499,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
}
|
||||
// List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
// List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//分析任务已全部上报
|
||||
List<BusinessAssayTaskDataDO> reportedList = businessAssayTaskDataMapper.selectIsReportedList(null, businessSubSampleId, configAssayMethodId, QmsCommonConstant.YES);
|
||||
//判定结果
|
||||
@@ -496,8 +514,29 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
//查询主样
|
||||
BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
|
||||
// List<Long> businessSubParentSampleIdList = reportedList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//查询分样
|
||||
BusinessSubParentSampleDO businessSubParentSampleDO = businessSubParentSampleMapper.selectById(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
|
||||
//查询分样对应的方法
|
||||
ConfigSubSampleParentMethodDO configSubSampleParentMethodDO = configSubSampleParentMethodMapper.selectByConfigSubSampleParentIdAndConfigAssayMethodId(businessSubParentSampleDO.getConfigSubSampleParentId(), configAssayMethodId);
|
||||
|
||||
//循环判定值
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = null;
|
||||
for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessment : businessSubSampleAssessmentList) {
|
||||
businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
businessSubParentSampleAssessmentDO.setAssessmentStatus(QmsCommonConstant.NORMAL);
|
||||
businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessment.getAssessmentValue());
|
||||
businessSubParentSampleAssessmentDO.setDataType(businessSubSampleAssessment.getDataType());
|
||||
businessSubParentSampleAssessmentDO.setDecimalPosition(businessSubSampleAssessment.getDecimalPosition());
|
||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(businessSubSampleAssessment.getConfigAssayMethodId());
|
||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodProjectId(businessSubSampleAssessment.getConfigAssayMethodProjectId());
|
||||
businessSubParentSampleAssessmentDO.setDictionaryProjectId(businessSubSampleAssessment.getDictionaryProjectId());
|
||||
|
||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -590,6 +629,11 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList);
|
||||
}
|
||||
**/
|
||||
|
||||
if (businessSubParentSampleAssessmentDOList.size() > 0) {
|
||||
businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList);
|
||||
}
|
||||
|
||||
businessSubSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubSampleAssessmentDO>()
|
||||
.set(BusinessSubSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
||||
.set(BusinessSubSampleAssessmentDO::getReporter, nickName)
|
||||
|
||||
@@ -43,6 +43,7 @@ import com.zt.plat.module.qms.common.data.dal.dataobject.DataCollectionDO;
|
||||
import com.zt.plat.module.qms.common.data.service.DataCollectionService;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
/**
|
||||
@@ -298,7 +299,9 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
businessAssayProjectDataMapper.updateBatch(businessAssayProjectDataList);
|
||||
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
|
||||
if (CollUtil.isNotEmpty(businessAssayParameterDataList)) {
|
||||
businessAssayParameterDataMapper.updateBatch(businessAssayParameterDataList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentMethodRespVO;
|
||||
|
||||
public interface SampleResultReportingService {
|
||||
|
||||
List<BusinessSubParentSampleAssessmentGroupRespVO> getUnReportMethodGroupList();
|
||||
|
||||
JSONObject getSampleResultReportingList(Long configAssayMethodId);
|
||||
|
||||
List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId);
|
||||
|
||||
void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO);
|
||||
|
||||
void batchResultDataReporting(BatchResultDataReportingReqVO reqVO);
|
||||
|
||||
JSONObject getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId);
|
||||
|
||||
void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,541 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
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.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BatchResultDataReportingReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleAssessmentExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.ModifySampleResultReportingReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.NoReportSubParentSampleAssessmentRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentCreateReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentMethodRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.ReportFieldValueData;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.ReportedDataSource;
|
||||
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.BusinessAssayTaskDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleParentRecheckDO;
|
||||
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.BusinessBaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigProjectExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportExtendRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSampleReportReqVO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
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.dataobject.ConfigReportFieldDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.BaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigAssayMethodMapper;
|
||||
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.ConfigProjectMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigReportFieldMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSampleReportMapper;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleMethodMapper;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
@Service
|
||||
public class SampleResultReportingServiceImpl implements SampleResultReportingService {
|
||||
|
||||
@Resource
|
||||
private BusinessAssayTaskDataMapper businessAssayTaskDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleMapper businessSubParentSampleMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleMapper businessSubSampleMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectMapper configAssayMethodProjectMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public List<BusinessSubParentSampleAssessmentGroupRespVO> getUnReportMethodGroupList() {
|
||||
List<BusinessSubParentSampleAssessmentGroupRespVO> list = businessSubParentSampleAssessmentMapper.selectUnReportMethodGroupList();
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getSampleResultReportingList(Long configAssayMethodId) {
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
||||
List<Map<String, Object>> columnList = new ArrayList<>();
|
||||
|
||||
//动态字段
|
||||
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProject : configAssayMethodProjectDOList) {
|
||||
columnList.add(new HashMap<String, Object>() {
|
||||
private static final long serialVersionUID = 2100402322138923549L;
|
||||
|
||||
{
|
||||
put("title", configAssayMethodProject.getShowName() + "(" + configAssayMethodProject.getDictionaryProjectUnit() + ")");
|
||||
put("field", configAssayMethodProject.getSimpleName());
|
||||
put("dataType", configAssayMethodProject.getDataType());
|
||||
put("decimalPosition", configAssayMethodProject.getDecimalPosition());
|
||||
put("isEdit", true);
|
||||
}});
|
||||
}
|
||||
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
//查询结果报送未上报的样品
|
||||
List<NoReportSubParentSampleAssessmentRespVO> noReportSubParentSampleAssessmentRespList = businessSubParentSampleAssessmentMapper.selectNoReportSubParentSampleAssessment(configAssayMethodId);
|
||||
//分样id列表
|
||||
List<Long> businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList());
|
||||
//报送的检测项目数据
|
||||
List<BusinessSubParentSampleAssessmentExtendRespVO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
//获取分析任务数
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
List<Long> businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
//获取子样数据
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds);
|
||||
|
||||
//获取结果判定数据
|
||||
List<BusinessSubSampleAssessmentExtendRespVO> businessSubSampleAssessmentExtendRespVOList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
|
||||
//获取复测业务数据
|
||||
List<BusinessSubSampleParentRecheckDO> businessSubSampleParentRecheckDOList = businessSubSampleParentRecheckMapper.selectByRecheckBusinessSubParentSampleIdsAndRecheckConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
|
||||
//循环未上报的样品
|
||||
for (NoReportSubParentSampleAssessmentRespVO noReportSubParentSampleAssessmentRespVO : noReportSubParentSampleAssessmentRespList) {
|
||||
Map<String, Object> noReportSubParentSampleAssessmentMap = BeanUtil.beanToMap(noReportSubParentSampleAssessmentRespVO);
|
||||
String sampleCode = businessSubSampleDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).map(m -> m.getSampleAssayCode()).distinct().collect(Collectors.joining(" | "));
|
||||
noReportSubParentSampleAssessmentMap.put("sampleCode", sampleCode);
|
||||
|
||||
Map<String, Object> subSampleAssessmentBeforeMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
||||
Map<String, Object> subSampleAssessmentMap = BeanUtil.copyProperties(noReportSubParentSampleAssessmentMap, Map.class);
|
||||
List<BusinessSubParentSampleAssessmentExtendRespVO> curBusinessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentDOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||
noReportSubParentSampleAssessmentMap.put("configAssayMethodName", "报出结果");
|
||||
StringBuilder businessSubParentSampleAssessmentIds = new StringBuilder();
|
||||
for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessmentDO : curBusinessSubParentSampleAssessmentDOList) {
|
||||
noReportSubParentSampleAssessmentMap.put(businessSubParentSampleAssessmentDO.getSimpleName(), businessSubParentSampleAssessmentDO.getAssessmentValue());
|
||||
businessSubParentSampleAssessmentIds.append(businessSubParentSampleAssessmentDO.getId()).append(",");
|
||||
}
|
||||
businessSubParentSampleAssessmentIds.delete(businessSubParentSampleAssessmentIds.length() -1, businessSubParentSampleAssessmentIds.length());
|
||||
noReportSubParentSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString());
|
||||
dataList.add(noReportSubParentSampleAssessmentMap);
|
||||
|
||||
//复测之前的判定数据
|
||||
BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = businessSubSampleParentRecheckDOList.stream().filter(f -> f.getRecheckBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).findFirst().orElse(null);
|
||||
if (businessSubSampleParentRecheckDO != null) {
|
||||
|
||||
List<BusinessSubSampleAssessmentExtendRespVO> businessSubSampleAssessmentExtendBeforeList = businessSubSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubSampleParentRecheckDO.getBusinessSubParentSampleId(), businessSubSampleParentRecheckDO.getConfigAssayMethodId());
|
||||
StringBuilder businessSubSampleAssessmentIdsBefore = new StringBuilder();
|
||||
for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentExtendBeforeList) {
|
||||
subSampleAssessmentBeforeMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName());
|
||||
subSampleAssessmentBeforeMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue());
|
||||
businessSubSampleAssessmentIdsBefore.append(businessSubSampleAssessmentExtendRespVO.getId()).append(",");
|
||||
}
|
||||
businessSubSampleAssessmentIdsBefore.delete(businessSubSampleAssessmentIdsBefore.length() -1, businessSubSampleAssessmentIdsBefore.length());
|
||||
subSampleAssessmentBeforeMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString());
|
||||
subSampleAssessmentBeforeMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIdsBefore.toString());
|
||||
|
||||
dataList.add(subSampleAssessmentBeforeMap);
|
||||
}
|
||||
|
||||
|
||||
List<BusinessSubSampleAssessmentExtendRespVO> businessSubSampleAssessmentList = businessSubSampleAssessmentExtendRespVOList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(noReportSubParentSampleAssessmentRespVO.getBusinessSubParentSampleId())).collect(Collectors.toList());
|
||||
StringBuilder businessSubSampleAssessmentIds = new StringBuilder();
|
||||
for (BusinessSubSampleAssessmentExtendRespVO businessSubSampleAssessmentExtendRespVO : businessSubSampleAssessmentList) {
|
||||
subSampleAssessmentMap.put("configAssayMethodName", businessSubSampleAssessmentExtendRespVO.getConfigAssayMethodName());
|
||||
subSampleAssessmentMap.put(businessSubSampleAssessmentExtendRespVO.getSimpleName(), businessSubSampleAssessmentExtendRespVO.getAssessmentValue());
|
||||
businessSubSampleAssessmentIds.append(businessSubSampleAssessmentExtendRespVO.getId()).append(",");
|
||||
}
|
||||
businessSubSampleAssessmentIds.delete(businessSubSampleAssessmentIds.length() -1, businessSubSampleAssessmentIds.length());
|
||||
subSampleAssessmentMap.put("businessSubParentSampleAssessmentIds", businessSubParentSampleAssessmentIds.toString());
|
||||
subSampleAssessmentMap.put("businessSubSampleAssessmentIds", businessSubSampleAssessmentIds.toString());
|
||||
|
||||
dataList.add(subSampleAssessmentMap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
List<Long> businessSubParentSampleIdList = businessSubParentSampleAssessmentDOList.stream().map(m -> m.getBusinessSubParentSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configAssayMethodId);
|
||||
|
||||
|
||||
|
||||
for (BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO : businessSubParentSampleAssessmentDOList) {
|
||||
//Map<String, Object> dataMap = new HashMap<>();
|
||||
Map<String, Object> dataMap = BeanUtil.beanToMap(businessSubParentSampleAssessmentDO);
|
||||
|
||||
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
**/
|
||||
|
||||
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("columns", columnList);
|
||||
json.put("datas", dataList);
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<RecheckSubSampleParentMethodRespVO> getRecheckAssayMethodList(Long baseSampleId, Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
//查询检查项目
|
||||
List<RecheckSubSampleParentMethodRespVO> list = businessSubParentSampleAssessmentMapper.getRecheckAssayMethodList(baseSampleId, businessSubParentSampleId, configAssayMethodId);
|
||||
//过滤默认的
|
||||
List<RecheckSubSampleParentMethodRespVO> resultList = list.stream().filter(f -> f.getIsRecheckDefault() != null && f.getIsRecheckDefault().equals(QmsCommonConstant.YES)).collect(Collectors.toList());
|
||||
for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : resultList) {
|
||||
List<ConfigAssayMethodRespVO> methodList = new ArrayList<>();
|
||||
//根据检查项目过滤方法
|
||||
List<RecheckSubSampleParentMethodRespVO> projectMethodList = list.stream().filter(f -> f.getDictionaryProjectId().equals(recheckSubSampleParentMethodRespVO.getDictionaryProjectId())).collect(Collectors.toList());
|
||||
for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethod : projectMethodList) {
|
||||
ConfigAssayMethodRespVO configAssayMethodRespVO = new ConfigAssayMethodRespVO();
|
||||
configAssayMethodRespVO.setId(recheckSubSampleParentMethod.getConfigAssayMethodId());
|
||||
configAssayMethodRespVO.setName(recheckSubSampleParentMethod.getConfigAssayMethodName());
|
||||
methodList.add(configAssayMethodRespVO);
|
||||
}
|
||||
recheckSubSampleParentMethodRespVO.setMethodList(methodList);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Resource
|
||||
private BaseSampleMapper baseSampleMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleMethodMapper configSubSampleMethodMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodMapper configAssayMethodMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectParameterMapper configAssayMethodProjectParameterMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayProjectDataMapper businessAssayProjectDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessAssayParameterDataMapper businessAssayParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleParentRecheckMapper businessSubSampleParentRecheckMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void createRecheckSample(RecheckSubSampleParentCreateReqVO reqVO) {
|
||||
|
||||
List<BusinessAssayTaskDataDO> newBusinessAssayTaskDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayProjectDataDO> newBusinessAssayProjectDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayParameterDataDO> newBusinessAssayParameterDataDOList = new ArrayList<>();
|
||||
List<BusinessSubSampleParentRecheckDO> newBusinessSubSampleParentRecheckDOList = new ArrayList<>();
|
||||
|
||||
//获取分析任务数
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleId(), reqVO.getConfigAssayMethodId());
|
||||
List<Long> businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//获取子样
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIds);
|
||||
|
||||
for (BusinessSubSampleDO businessSubSampleDO : businessSubSampleDOList) {
|
||||
|
||||
//复检的检测项目
|
||||
List<RecheckSubSampleParentMethodRespVO> recheckProjectList = reqVO.getRecheckProjectList();
|
||||
|
||||
//根据方法分组
|
||||
Map<Long, List<RecheckSubSampleParentMethodRespVO>> recheckProjectMap = recheckProjectList.stream().collect(Collectors.groupingBy(RecheckSubSampleParentMethodRespVO::getConfigAssayMethodId));
|
||||
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
for (Map.Entry<Long, List<RecheckSubSampleParentMethodRespVO>> entry : recheckProjectMap.entrySet()) {
|
||||
Long configAssayMethodId = entry.getKey();
|
||||
List<RecheckSubSampleParentMethodRespVO> projectList = entry.getValue();
|
||||
|
||||
BusinessSubSampleParentRecheckDO businessSubSampleParentRecheckDO = new BusinessSubSampleParentRecheckDO();
|
||||
businessSubSampleParentRecheckDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleParentRecheckDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleParentRecheckDO.setConfigAssayMethodId(reqVO.getConfigAssayMethodId());
|
||||
businessSubSampleParentRecheckDO.setRecheckBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessSubSampleParentRecheckDO.setRecheckBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessSubSampleParentRecheckDO.setRecheckConfigAssayMethodId(configAssayMethodId);
|
||||
|
||||
newBusinessSubSampleParentRecheckDOList.add(businessSubSampleParentRecheckDO);
|
||||
|
||||
//查询分析方法
|
||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodMapper.selectById(configAssayMethodId);
|
||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodMapper.selectByConfigSubSampleIdAndConfigAssayMethodId(businessSubSampleDO.getConfigSubSampleId(), configAssayMethodId);
|
||||
|
||||
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodId(configAssayMethodId);
|
||||
|
||||
//根据任务数判断是平行还是
|
||||
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
//子样检测任务
|
||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodId);
|
||||
businessAssayTaskDataDO.setAssayType(assayType);
|
||||
businessAssayTaskDataDO.setTaskType("复测");
|
||||
businessAssayTaskDataDO.setConfigSampleFlowId(businessSubSampleDO.getConfigSampleFlowId());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeKey(businessSubSampleDO.getSampleFlowNodeKey());
|
||||
businessAssayTaskDataDO.setSampleFlowNodeTime(LocalDateTime.now());
|
||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodDO.getAssayDepartmentId());
|
||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||
|
||||
|
||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||
|
||||
for (RecheckSubSampleParentMethodRespVO recheckSubSampleParentMethodRespVO : projectList) {
|
||||
ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getDictionaryProjectId().equals(recheckSubSampleParentMethodRespVO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||
|
||||
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);
|
||||
|
||||
newBusinessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||
|
||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodProjectId(configAssayMethodId);
|
||||
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());
|
||||
|
||||
|
||||
newBusinessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
|
||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||
newBusinessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(newBusinessAssayTaskDataDOList)) {
|
||||
businessAssayTaskDataMapper.insertBatch(newBusinessAssayTaskDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(newBusinessAssayProjectDataDOList)) {
|
||||
businessAssayProjectDataMapper.insertBatch(newBusinessAssayProjectDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(newBusinessAssayParameterDataDOList)) {
|
||||
businessAssayParameterDataMapper.insertBatch(newBusinessAssayParameterDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(newBusinessSubSampleParentRecheckDOList)) {
|
||||
businessSubSampleParentRecheckMapper.insertBatch(newBusinessSubSampleParentRecheckDOList);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private BusinessAssayReportDataMapper businessAssayReportDataMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigSampleReportMapper configSampleReportMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigReportFieldMapper configReportFieldMapper;
|
||||
|
||||
@Resource
|
||||
private ConfigProjectMapper configProjectMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessBaseSampleMapper businessBaseSampleMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchResultDataReporting(BatchResultDataReportingReqVO reqVO) {
|
||||
|
||||
//当前登录用户昵称
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
|
||||
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
List<BusinessSubParentSampleAssessmentExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
|
||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||
|
||||
for (BusinessSubParentSampleDO businessSubParentSampleDO : businessSubParentSampleDOList) {
|
||||
|
||||
BusinessBaseSampleDO businessBaseSampleDO = businessBaseSampleMapper.selectById(businessSubParentSampleDO.getBusinessBaseSampleId());
|
||||
|
||||
//查询报表
|
||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = businessAssayReportDataMapper.selectBytBusinessBaseSampleId(businessSubParentSampleDO.getBusinessBaseSampleId());
|
||||
|
||||
ConfigSampleReportReqVO configSampleReportSearch = new ConfigSampleReportReqVO();
|
||||
configSampleReportSearch.setConfigBaseSampleId(businessBaseSampleDO.getConfigBaseSampleId());
|
||||
List<ConfigSampleReportExtendRespVO> configSampleReportList = configSampleReportMapper.selectList(configSampleReportSearch);
|
||||
|
||||
List<Long> configReportTypeIdList = configSampleReportList.stream().map(m -> m.getConfigReportTypeId()).collect(Collectors.toList());
|
||||
|
||||
//查询动态和计算的报表字段
|
||||
List<ConfigReportFieldDO> configReportFieldList = configReportFieldMapper.selectByConfigReportTypeIds(configReportTypeIdList, Arrays.asList(QmsCommonConstant.FIELD_DYNAMIC, QmsCommonConstant.FIELD_CALCULATED));
|
||||
//动态报表字段
|
||||
List<ConfigReportFieldDO> configReportFieldDynamicList = configReportFieldList.stream().filter(f -> QmsCommonConstant.FIELD_DYNAMIC.equals(f.getFieldType())).collect(Collectors.toList());
|
||||
//根据检测方法查询字段配置
|
||||
List<ConfigProjectExtendRespVO> configProjectList = configProjectMapper.selectByConfigAssayMethodId(reqVO.getConfigAssayMethodId());
|
||||
|
||||
|
||||
for (ConfigSampleReportExtendRespVO configSampleReport : configSampleReportList) {
|
||||
BusinessAssayReportDataDO businessAssayReportDataDO = businessAssayReportDataDOList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getConfigSampleReportId().equals(configSampleReport.getId())).findFirst().orElse(null);
|
||||
if (businessAssayReportDataDO == null) {
|
||||
businessAssayReportDataDO = new BusinessAssayReportDataDO();
|
||||
businessAssayReportDataDO.setBusinessBaseSampleId(businessSubParentSampleDO.getBusinessBaseSampleId());
|
||||
businessAssayReportDataDO.setConfigReportTypeId(configSampleReport.getConfigReportTypeId());
|
||||
businessAssayReportDataDO.setConfigSampleReportId(configSampleReport.getId());
|
||||
businessAssayReportDataDO.setSampleCode(businessBaseSampleDO.getSampleCode());
|
||||
|
||||
saveBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||
} else {
|
||||
updateBusinessAssayReportDataDOList.add(businessAssayReportDataDO);
|
||||
}
|
||||
JSONObject assayDataJson = new JSONObject();
|
||||
String assayData = businessAssayReportDataDO.getAssayData();
|
||||
if (StringUtils.isNotBlank(assayData)) {
|
||||
assayDataJson = JSON.parseObject(assayData);
|
||||
}
|
||||
//循环判定值
|
||||
List<BusinessSubParentSampleAssessmentExtendRespVO> businessSubParentSampleAssessmentList = businessSubParentSampleAssessmentExtendList.stream().filter(f -> f.getBusinessSubParentSampleId().equals(businessSubParentSampleDO.getId())).collect(Collectors.toList());
|
||||
for (BusinessSubParentSampleAssessmentExtendRespVO businessSubParentSampleAssessment : businessSubParentSampleAssessmentList) {
|
||||
Long configAssayMethodProjectId = businessSubParentSampleAssessment.getConfigAssayMethodProjectId();
|
||||
List<ConfigProjectExtendRespVO> configProjectFeildList = configProjectList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectId)).collect(Collectors.toList());
|
||||
for (ConfigProjectExtendRespVO configProjectFeild : configProjectFeildList) {
|
||||
//查询动态报表字段
|
||||
ConfigReportFieldDO configReportField = configReportFieldDynamicList.stream().filter(f -> f.getConfigReportTypeId().equals(configSampleReport.getConfigReportTypeId()) && f.getField().equals(configProjectFeild.getSaveColumn())).findFirst().orElse(null);
|
||||
|
||||
if (configReportField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ReportFieldValueData reportFieldValueData = new ReportFieldValueData();
|
||||
reportFieldValueData.setFieldName(configReportField.getFieldName());
|
||||
reportFieldValueData.setFieldValue(businessSubParentSampleAssessment.getAssessmentValue());
|
||||
reportFieldValueData.setDataType(configReportField.getDataType());
|
||||
reportFieldValueData.setMathSymbol("=");
|
||||
reportFieldValueData.setUnit(configProjectFeild.getDictionaryProjectUnit());
|
||||
assayDataJson.put(configReportField.getField(), reportFieldValueData);
|
||||
}
|
||||
}
|
||||
businessAssayReportDataDO.setAssayData(assayDataJson.toJSONString());
|
||||
|
||||
//修改已上报数据来源
|
||||
String dataSource = businessAssayReportDataDO.getDataSource();
|
||||
Set<String> dataSources = StringUtils.isBlank(dataSource) ? new HashSet<>() : new HashSet<>(Arrays.asList(dataSource.split(",")));
|
||||
String reportedSource = businessAssayReportDataDO.getReportedSource();
|
||||
ReportedDataSource reportedDataSource = null;
|
||||
if (StringUtils.isNotBlank(reportedSource)) {
|
||||
reportedDataSource = JSON.parseObject(reportedSource, ReportedDataSource.class);
|
||||
} else {
|
||||
reportedDataSource = new ReportedDataSource();
|
||||
}
|
||||
reportedDataSource.addDataSource(reqVO.getConfigAssayMethodId().toString(), nickName, LocalDateTime.now());
|
||||
Set<String> busDataSources = reportedDataSource.getDetails().stream().map(m -> m.getSourceCode()).collect(Collectors.toSet());
|
||||
if (busDataSources.size() == dataSources.size() && busDataSources.equals(dataSources)) {
|
||||
businessAssayReportDataDO.setIsAllReported(QmsCommonConstant.YES);
|
||||
}
|
||||
if (busDataSources.size() > 0) {
|
||||
//计算
|
||||
// TODO
|
||||
}
|
||||
businessAssayReportDataDO.setReportedSource(JSON.toJSONString(reportedDataSource));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (saveBusinessAssayReportDataDOList.size() > 0) {
|
||||
businessAssayReportDataMapper.insertBatch(saveBusinessAssayReportDataDOList);
|
||||
}
|
||||
if (updateBusinessAssayReportDataDOList.size() > 0) {
|
||||
businessAssayReportDataMapper.updateBatch(updateBusinessAssayReportDataDOList);
|
||||
}
|
||||
|
||||
List<Long> businessSubParentSampleAssessmentIdList = businessSubParentSampleAssessmentExtendList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
|
||||
businessSubParentSampleAssessmentMapper.update(new LambdaUpdateWrapper<BusinessSubParentSampleAssessmentDO>()
|
||||
.set(BusinessSubParentSampleAssessmentDO::getIsReported, QmsCommonConstant.YES)
|
||||
.set(BusinessSubParentSampleAssessmentDO::getReporter, nickName)
|
||||
.set(BusinessSubParentSampleAssessmentDO::getReportTime, LocalDateTime.now())
|
||||
.in(BusinessSubParentSampleAssessmentDO::getId, businessSubParentSampleAssessmentIdList));
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getSingleSampleResultReportingList(Long businessSubParentSampleId, Long configAssayMethodId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void modifySampleResultReporting(ModifySampleResultReportingReqVO reqVO) {
|
||||
List<String> businessSubParentSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubParentSampleAssessmentIds().split(","));
|
||||
List<String> businessSubSampleAssessmentIdList = Arrays.asList(reqVO.getBusinessSubSampleAssessmentIds().split(","));
|
||||
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentMapper.selectByIds(businessSubParentSampleAssessmentIdList);
|
||||
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList = businessSubSampleAssessmentMapper.selectByIds(businessSubSampleAssessmentIdList);
|
||||
for (BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO : businessSubParentSampleAssessmentDOList) {
|
||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = businessSubSampleAssessmentDOList.stream().filter(f -> f.getDictionaryProjectId().equals(businessSubParentSampleAssessmentDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||
businessSubParentSampleAssessmentDO.setAssessmentValue(businessSubSampleAssessmentDO.getAssessmentValue());
|
||||
}
|
||||
businessSubParentSampleAssessmentMapper.updateBatch(businessSubParentSampleAssessmentDOList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -31,6 +31,9 @@ public class MaterialAssayStandardMethodPageReqVO extends PageParam {
|
||||
@Schema(description = "是否默认,1-是,0-否")
|
||||
private Integer isDefault;
|
||||
|
||||
@Schema(description = "是否复检默认,1-是,0-否")
|
||||
private Integer isRecheckDefault;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -40,6 +40,9 @@ public class MaterialAssayStandardMethodRespVO {
|
||||
@ExcelProperty("是否默认,1-是,0-否")
|
||||
private Integer isDefault;
|
||||
|
||||
@Schema(description = "是否复检默认,1-是,0-否")
|
||||
private Integer isRecheckDefault;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -33,6 +33,9 @@ public class MaterialAssayStandardMethodSaveReqVO {
|
||||
@NotNull(message = "是否默认,1-是,0-否不能为空")
|
||||
private Integer isDefault;
|
||||
|
||||
@Schema(description = "是否复检默认,1-是,0-否")
|
||||
private Integer isRecheckDefault;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ public class MaterialAssayStandardMethodDO extends BusinessBaseDO {
|
||||
@TableField("IS_DFT")
|
||||
private Integer isDefault;
|
||||
/**
|
||||
* 是否复检默认,1-是,0-否
|
||||
*/
|
||||
@TableField("IS_RCHK_DFT")
|
||||
private Integer isRecheckDefault;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
|
||||
@@ -27,5 +27,17 @@ public interface ConfigSubSampleParentMethodMapper extends BaseMapperX<ConfigSub
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ConfigSubSampleParentMethodDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分样id与分析方法id查询
|
||||
* @param configSubSampleParentId
|
||||
* @param configAssayMethodId
|
||||
* @return
|
||||
*/
|
||||
default ConfigSubSampleParentMethodDO selectByConfigSubSampleParentIdAndConfigAssayMethodId(Long configSubSampleParentId, Long configAssayMethodId) {
|
||||
return selectOne(new LambdaQueryWrapperX<ConfigSubSampleParentMethodDO>()
|
||||
.eq(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, configSubSampleParentId)
|
||||
.eq(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public interface MaterialAssayStandardMethodMapper extends BaseMapperX<MaterialA
|
||||
.likeIfPresent(MaterialAssayStandardMethodDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||
.eqIfPresent(MaterialAssayStandardMethodDO::getIsDualCup, reqVO.getIsDualCup())
|
||||
.eqIfPresent(MaterialAssayStandardMethodDO::getIsDefault, reqVO.getIsDefault())
|
||||
.eqIfPresent(MaterialAssayStandardMethodDO::getIsRecheckDefault, reqVO.getIsRecheckDefault())
|
||||
.eqIfPresent(MaterialAssayStandardMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(MaterialAssayStandardMethodDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(MaterialAssayStandardMethodDO::getRemark, reqVO.getRemark())
|
||||
|
||||
@@ -9,4 +9,110 @@
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectUnReportMethodGroupList" resultType="com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO" >
|
||||
SELECT
|
||||
tbspsa.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
tcam.NAME AS configAssayMethodName,
|
||||
COUNT(DISTINCT tbspsa.BSN_SB_PRN_SMP_ID) AS sampleCount
|
||||
FROM
|
||||
T_BSN_SB_PRN_SMP_ASMT tbspsa
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tbspsa.CFG_ASY_MTHD_ID = tcam.ID
|
||||
WHERE
|
||||
tbspsa.DELETED = 0
|
||||
AND tbspsa.IS_RPOD = 0
|
||||
GROUP BY
|
||||
tbspsa.CFG_ASY_MTHD_ID,
|
||||
tcam.NAME
|
||||
</select>
|
||||
|
||||
<select id="selectNoReportSubParentSampleAssessment" resultType="com.zt.plat.module.qms.business.bus.controller.vo.NoReportSubParentSampleAssessmentRespVO" >
|
||||
SELECT
|
||||
tcssp.BSE_SMP_ID AS baseSampleId,
|
||||
tbsps.BSN_BSE_SMP_ID AS businessBaseSampleId,
|
||||
tbssa.BSN_SB_PRN_SMP_ID AS businessSubParentSampleId,
|
||||
tbssa.CFG_ASY_MTHD_ID AS configAssayMethodId ,
|
||||
tbssa.TSK_TP AS taskType,
|
||||
tbssa.ASY_TP AS assayType,
|
||||
tbsps.CFG_SB_SMP_PRN_ID AS configSubSampleParentId,
|
||||
tbsps.SMP_NAME AS sampleName,
|
||||
tbs.NAME AS baseSampleName
|
||||
FROM
|
||||
T_BSN_SB_SMP_ASMT tbssa
|
||||
LEFT JOIN T_BSN_SB_PRN_SMP tbsps ON
|
||||
tbssa.BSN_SB_PRN_SMP_ID = tbsps.ID
|
||||
LEFT JOIN T_CFG_SB_SMP_PRN tcssp ON
|
||||
tbsps.CFG_SB_SMP_PRN_ID = tcssp.ID
|
||||
LEFT JOIN T_BSE_SMP tbs ON
|
||||
tcssp.BSE_SMP_ID = tbs.ID
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
tbspsa.BSN_SB_PRN_SMP_ID ,
|
||||
tbspsa.CFG_ASY_MTHD_ID ,
|
||||
tbspsa.IS_RPOD
|
||||
FROM
|
||||
T_BSN_SB_PRN_SMP_ASMT tbspsa
|
||||
WHERE
|
||||
tbspsa.IS_RPOD = 0
|
||||
AND tbspsa.CFG_ASY_MTHD_ID = #{configAssayMethodId}
|
||||
GROUP BY
|
||||
tbspsa.BSN_SB_PRN_SMP_ID ,
|
||||
tbspsa.CFG_ASY_MTHD_ID ,
|
||||
tbspsa.IS_RPOD
|
||||
) t ON
|
||||
tbssa.BSN_SB_PRN_SMP_ID = t.BSN_SB_PRN_SMP_ID
|
||||
WHERE
|
||||
tbssa.IS_RPOD = 1
|
||||
AND t.IS_RPOD = 0
|
||||
AND tbssa.CFG_ASY_MTHD_ID = #{configAssayMethodId}
|
||||
GROUP BY
|
||||
tcssp.BSE_SMP_ID ,
|
||||
tbsps.BSN_BSE_SMP_ID ,
|
||||
tbssa.BSN_SB_PRN_SMP_ID,
|
||||
tbssa.CFG_ASY_MTHD_ID,
|
||||
tbssa.TSK_TP ,
|
||||
tbssa.ASY_TP ,
|
||||
tbsps.CFG_SB_SMP_PRN_ID,
|
||||
tbsps.SMP_NAME ,
|
||||
tbs.NAME
|
||||
</select>
|
||||
|
||||
<select id="getRecheckAssayMethodList" resultType="com.zt.plat.module.qms.business.bus.controller.vo.RecheckSubSampleParentMethodRespVO">
|
||||
SELECT
|
||||
tmasd.DIC_PRJ_ID dictionaryProjectId,
|
||||
tdp.NAME AS dictionaryProjectName,
|
||||
tdp.SMPL_NAME AS dictionaryProjectSimpleName,
|
||||
tdp.SHW_NAME AS dictionaryProjectShowName,
|
||||
tmasm.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
tcam.NAME AS configAssayMethodName,
|
||||
tmas.BSE_SMP_ID AS baseSampleId,
|
||||
tbs.NAME AS baseSampleName,
|
||||
tmasm.IS_RCHK_DFT AS isRecheckDefault
|
||||
FROM
|
||||
T_MTRL_ASY_STD_MTHD tmasm
|
||||
LEFT JOIN T_MTRL_ASY_STD_DTL tmasd ON
|
||||
tmasm.MTRL_ASY_STD_DTL_ID = tmasd.ID
|
||||
LEFT JOIN T_MTRL_ASY_STD tmas ON
|
||||
tmasd.MTRL_ASY_STD_ID = tmas.ID
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tmasm.CFG_ASY_MTHD_ID = tcam.ID
|
||||
LEFT JOIN T_BSE_SMP tbs ON
|
||||
tmas.BSE_SMP_ID = tbs.ID
|
||||
LEFT JOIN T_DIC_PRJ tdp ON tmasd.DIC_PRJ_ID = tdp.ID
|
||||
WHERE
|
||||
tmasm.DELETED = 0
|
||||
AND tmas.BSE_SMP_ID = #{baseSampleId}
|
||||
AND tmasd.DIC_PRJ_ID IN (
|
||||
SELECT
|
||||
tbspsa.DIC_PRJ_ID
|
||||
FROM
|
||||
T_BSN_SB_PRN_SMP_ASMT tbspsa
|
||||
WHERE
|
||||
tbspsa.BSN_SB_PRN_SMP_ID = #{businessSubParentSampleId}
|
||||
AND tbspsa.CFG_ASY_MTHD_ID = #{configAssayMethodId}
|
||||
)
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleParentRecheckMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user