Compare commits

..

2 Commits

Author SHA1 Message Date
wxr
1f8aebf598 Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test 2025-11-19 17:04:28 +08:00
wxr
caba1edf4c 子样字段添加及查询修改 2025-11-19 17:04:21 +08:00
23 changed files with 260 additions and 16 deletions

View File

@@ -106,6 +106,14 @@ public class BusinessSubSampleController implements BusinessControllerMarker {
return success(pageResult); return success(pageResult);
} }
@GetMapping("/page-analysis-group")
@Operation(summary = "获得子样分析部门分页")
//@PreAuthorize("@ss.hasPermission('qms:business-sub-sample:query')")
public CommonResult<PageResult<BusinessSubSampleExtendRespVO>> getAnalysisGroupPage(@Valid BusinessSubSamplePageReqVO pageReqVO) {
PageResult<BusinessSubSampleExtendRespVO> pageResult = businessSubSampleService.getAnalysisGroupPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/page-stock") @GetMapping("/page-stock")
@Operation(summary = "查询样品库分页数据") @Operation(summary = "查询样品库分页数据")
public CommonResult<PageResult<BusinessSubSampleExtendRespVO>> pageStock(@Valid BusinessSubSamplePageReqVO pageReqVO) { public CommonResult<PageResult<BusinessSubSampleExtendRespVO>> pageStock(@Valid BusinessSubSamplePageReqVO pageReqVO) {

View File

@@ -151,6 +151,8 @@ public class BusinessSampleEntrustRegistrationPageReqVO extends PageParam {
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
@Schema(description = "部门id")
private Long deptId;
//====================扩展字段====================== //====================扩展字段======================
@Schema(description = "委托来源名称") @Schema(description = "委托来源名称")
private String configEntrustSourceName; private String configEntrustSourceName;

View File

@@ -1,7 +1,9 @@
package com.zt.plat.module.qms.business.bus.controller.vo; package com.zt.plat.module.qms.business.bus.controller.vo;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
@@ -18,6 +20,39 @@ public class BusinessSubSampleExtendRespVO extends BusinessSubSampleRespVO {
@Schema(description = "子样检测方法") @Schema(description = "子样检测方法")
private List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataList; private List<BusinessAssayTaskDataExtendRespVO> businessAssayTaskDataList;
@Schema(description = "分析班组")
private List<BusinessSubSampleAnalysisGroupRespVO> businessSubSampleAnalysisGroupList;
@Schema(description = "样品去向")
private String sampleDestination;
public String getSampleDestination() {
String _sampleDestination = null;
if (CollUtil.isNotEmpty(this.businessSubSampleAnalysisGroupList)) {
List<String> collect = this.businessSubSampleAnalysisGroupList.stream().filter(f -> f.getSampleStatus().equals("待收样")).map(m -> m.getAssayDepartmentName()).collect(Collectors.toList());
_sampleDestination = CollUtil.join(collect, ",");
}
return _sampleDestination;
}
@Schema(description = "样品所在位置")
private String sampleLocation;
public String getSampleLocation() {
this.sampleLocation = null;
if (CollUtil.isNotEmpty(this.businessSubSampleAnalysisGroupList)) {
List<String> collect = this.businessSubSampleAnalysisGroupList.stream().filter(f -> f.getSampleStatus().equals("已收样")).map(m -> m.getAssayDepartmentName()).collect(Collectors.toList());
this.sampleLocation = CollUtil.join(collect, ",");
}
return this.sampleLocation;
}
@Schema(description = "分析部门id")
private Long assayDepartmentId;
@Schema(description = "分析部门名称")
private String assayDepartmentName;
@Schema(description = "是否打印") @Schema(description = "是否打印")
private Integer isPrint; private Integer isPrint;

View File

@@ -1,8 +1,6 @@
package com.zt.plat.module.qms.business.bus.controller.vo; package com.zt.plat.module.qms.business.bus.controller.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*; import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.pojo.PageParam;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -48,6 +46,9 @@ public class BusinessSubSamplePageReqVO extends PageParam {
@Schema(description = "归库编号") @Schema(description = "归库编号")
private String sampleReturnCode; private String sampleReturnCode;
@Schema(description = "是否已经生成归库编号,1-已生成0-未生成")
private Integer isGenerateReturnCode;
@Schema(description = "是否称重,1-启用0-不启用") @Schema(description = "是否称重,1-启用0-不启用")
private Integer isWeighing; private Integer isWeighing;
@@ -132,6 +133,15 @@ public class BusinessSubSamplePageReqVO extends PageParam {
@Schema(description = "备注") @Schema(description = "备注")
private String remark; private String remark;
@Schema(description = "分析部门id")
private Long assayDepartmentId;
@Schema(description = "分析部门名称")
private String assayDepartmentName;
@Schema(description = "分析部门状态")
private String assayDepartmentStatus;
//扩展字段 //扩展字段
@Schema(description = "库位编码") @Schema(description = "库位编码")
private String warehouseLocationCode; private String warehouseLocationCode;

View File

@@ -47,6 +47,9 @@ public class BusinessSubSampleReqVO {
@Schema(description = "归库编号") @Schema(description = "归库编号")
private String sampleReturnCode; private String sampleReturnCode;
@Schema(description = "是否已经生成归库编号,1-已生成0-未生成")
private Integer isGenerateReturnCode;
@Schema(description = "是否称重,1-启用0-不启用") @Schema(description = "是否称重,1-启用0-不启用")
private Integer isWeighing; private Integer isWeighing;

View File

@@ -62,6 +62,9 @@ public class BusinessSubSampleRespVO {
@ExcelProperty("归库编号") @ExcelProperty("归库编号")
private String sampleReturnCode; private String sampleReturnCode;
@Schema(description = "是否已经生成归库编号,1-已生成0-未生成")
private Integer isGenerateReturnCode;
@Schema(description = "是否称重,1-启用0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "是否称重,1-启用0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否称重,1-启用0-不启用") @ExcelProperty("是否称重,1-启用0-不启用")
private Integer isWeighing; private Integer isWeighing;

View File

@@ -55,6 +55,9 @@ public class BusinessSubSampleSaveReqVO {
@Schema(description = "归库编号") @Schema(description = "归库编号")
private String sampleReturnCode; private String sampleReturnCode;
@Schema(description = "是否已经生成归库编号,1-已生成0-未生成")
private Integer isGenerateReturnCode;
@Schema(description = "是否称重,1-启用0-不启用", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "是否称重,1-启用0-不启用", requiredMode = Schema.RequiredMode.REQUIRED)
// @NotNull(message = "是否称重,1-启用0-不启用不能为空") // @NotNull(message = "是否称重,1-启用0-不启用不能为空")
private Integer isWeighing; private Integer isWeighing;

View File

@@ -93,6 +93,11 @@ public class BusinessSubSampleDO extends BusinessBaseDO {
@TableField("SMP_RTN_CD") @TableField("SMP_RTN_CD")
private String sampleReturnCode; private String sampleReturnCode;
/** /**
* 是否已经生成归库编号,1-已生成0-未生成
*/
@TableField("IS_GEN_RTN_CD")
private Integer isGenerateReturnCode;
/**
* 是否称重,1-启用0-不启用 * 是否称重,1-启用0-不启用
*/ */
@TableField("IS_WG") @TableField("IS_WG")

View File

@@ -72,6 +72,7 @@ public interface BusinessSampleEntrustRegistrationMapper extends BaseMapperX<Bus
.betweenIfPresent(BusinessSampleEntrustRegistrationDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(BusinessSampleEntrustRegistrationDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessSampleEntrustRegistrationDO::getUpdateCount, reqVO.getUpdateCount()) .eqIfPresent(BusinessSampleEntrustRegistrationDO::getUpdateCount, reqVO.getUpdateCount())
.eqIfPresent(BusinessSampleEntrustRegistrationDO::getRemark, reqVO.getRemark()) .eqIfPresent(BusinessSampleEntrustRegistrationDO::getRemark, reqVO.getRemark())
.eqIfPresent(BusinessSampleEntrustRegistrationDO::getDeptId, reqVO.getDeptId())
.eqIfPresent(ConfigEntrustSourceDO::getName, reqVO.getConfigEntrustSourceName()) .eqIfPresent(ConfigEntrustSourceDO::getName, reqVO.getConfigEntrustSourceName())
.orderByDesc(BusinessSampleEntrustRegistrationDO::getId)); .orderByDesc(BusinessSampleEntrustRegistrationDO::getId));
} }

View File

@@ -36,6 +36,11 @@ public interface BusinessSubSampleAnalysisGroupMapper extends BaseMapperX<Busine
.orderByDesc(BusinessSubSampleAnalysisGroupDO::getId)); .orderByDesc(BusinessSubSampleAnalysisGroupDO::getId));
} }
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleIds(List<Long> businessSubSampleIds) {
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds));
}
default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleIdsAndAssayDepartmentId(List<Long> businessSubSampleIds, Long assayDepartmentId) { default List<BusinessSubSampleAnalysisGroupDO> selectByBusinessSubSampleIdsAndAssayDepartmentId(List<Long> businessSubSampleIds, Long assayDepartmentId) {
return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>() return selectList(new LambdaQueryWrapperX<BusinessSubSampleAnalysisGroupDO>()
.in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds) .in(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, businessSubSampleIds)

View File

@@ -9,6 +9,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleExtend
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSamplePageReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSamplePageReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubSampleReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
@@ -84,6 +85,61 @@ public interface BusinessSubSampleMapper extends BaseMapperX<BusinessSubSampleDO
.orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode)); .orderByDesc(BusinessSubSampleDO::getSampleFlowNodeTime).orderByAsc(BusinessSubSampleDO::getSampleCode));
} }
default PageResult<BusinessSubSampleExtendRespVO> selectAnalysisGroupPage(BusinessSubSamplePageReqVO reqVO) {
return selectJoinPage(reqVO, BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleDO>()
.rightJoin(BusinessSubSampleAnalysisGroupDO.class, BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessSubSampleDO::getId)
.leftJoin(ConfigSubSampleDO.class, ConfigSubSampleDO::getId, BusinessSubSampleDO::getConfigSubSampleId)
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, BusinessSubSampleDO::getDictionaryBusinessId)
.selectAll(BusinessSubSampleDO.class)
.selectAs(DictionaryBusinessDO::getName, BusinessSubSampleExtendRespVO::getDictionaryBusinessName)
.selectAs(ConfigSubSampleDO::getIsPrint, BusinessSubSampleExtendRespVO::getIsPrint)
.selectAs(ConfigSubSampleDO::getPrintTemplate, BusinessSubSampleExtendRespVO::getPrintTemplate)
.selectAs(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessSubSampleExtendRespVO::getAssayDepartmentId)
.selectAs(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, BusinessSubSampleExtendRespVO::getAssayDepartmentName)
.eqIfPresent(BusinessSubSampleDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
.eqIfPresent(BusinessSubSampleDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
.eqIfPresent(BusinessSubSampleDO::getConfigSubSampleId, reqVO.getConfigSubSampleId())
.eqIfPresent(BusinessSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
.eqIfPresent(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, reqVO.getConfigWarehouseLocationInfomationId())
.eqIfPresent(BusinessSubSampleDO::getSampleId, reqVO.getSampleId())
.eqIfPresent(BusinessSubSampleDO::getGroupId, reqVO.getGroupId())
.likeIfPresent(BusinessSubSampleDO::getSampleName, reqVO.getSampleName())
.eqIfPresent(BusinessSubSampleDO::getSampleCode, reqVO.getSampleCode())
.eqIfPresent(BusinessSubSampleDO::getSampleAssayCode, reqVO.getSampleAssayCode())
.eqIfPresent(BusinessSubSampleDO::getSampleReturnCode, reqVO.getSampleReturnCode())
.eqIfPresent(BusinessSubSampleDO::getIsWeighing, reqVO.getIsWeighing())
.eqIfPresent(BusinessSubSampleDO::getLastSampleWeight, reqVO.getLastSampleWeight())
.eqIfPresent(BusinessSubSampleDO::getLastBalanceCode, reqVO.getLastBalanceCode())
.eqIfPresent(BusinessSubSampleDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId())
.eqIfPresent(BusinessSubSampleDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey())
.betweenIfPresent(BusinessSubSampleDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime())
.eqIfPresent(BusinessSubSampleDO::getNextSampleFlowNode, reqVO.getNextSampleFlowNode())
.eqIfPresent(BusinessSubSampleDO::getSampleStatus, reqVO.getSampleStatus())
.eqIfPresent(BusinessSubSampleDO::getAssayOperator, reqVO.getAssayOperator())
.eqIfPresent(BusinessSubSampleDO::getIsAssignTasked, reqVO.getIsAssignTasked())
.betweenIfPresent(BusinessSubSampleDO::getAssignTaskTime, reqVO.getAssignTaskTime())
.eqIfPresent(BusinessSubSampleDO::getIsReported, reqVO.getIsReported())
.eqIfPresent(BusinessSubSampleDO::getReporter, reqVO.getReporter())
.betweenIfPresent(BusinessSubSampleDO::getReportTime, reqVO.getReportTime())
.betweenIfPresent(BusinessSubSampleDO::getReturnTime, reqVO.getReturnTime())
.eqIfPresent(BusinessSubSampleDO::getReturnStatus, reqVO.getReturnStatus())
.eqIfPresent(BusinessSubSampleDO::getDispatchStatus, reqVO.getDispatchStatus())
.eqIfPresent(BusinessSubSampleDO::getReturnCodePrintCount, reqVO.getReturnCodePrintCount())
.betweenIfPresent(BusinessSubSampleDO::getPrintLastTime, reqVO.getPrintLastTime())
.eqIfPresent(BusinessSubSampleDO::getUpSampleRecordId, reqVO.getUpSampleRecordId())
.eqIfPresent(BusinessSubSampleDO::getAnalysisRemark, reqVO.getAnalysisRemark())
.eqIfPresent(BusinessSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(BusinessSubSampleDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessSubSampleDO::getUpdateCount, reqVO.getUpdateCount())
.eqIfPresent(BusinessSubSampleDO::getRemark, reqVO.getRemark())
.eqIfPresent(BusinessSubSampleDO::getUpSampleRecordId, reqVO.getUpSampleRecordId())
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
.eqIfPresent(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getAssayDepartmentStatus())
.orderByAsc(BusinessSubSampleDO::getSampleCode)
);
}
default List<BusinessSubSampleExtendRespVO> selectList(@Valid BusinessSubSampleReqVO reqVO) { default List<BusinessSubSampleExtendRespVO> selectList(@Valid BusinessSubSampleReqVO reqVO) {
return selectJoinList(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleDO>() return selectJoinList(BusinessSubSampleExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubSampleDO>()
.selectSub(BusinessAssayTaskDataDO.class, s -> s.selectCount(BusinessAssayTaskDataDO::getId).eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessSubSampleDO::getId), BusinessSubSampleExtendRespVO::getAssayTaskCount) .selectSub(BusinessAssayTaskDataDO.class, s -> s.selectCount(BusinessAssayTaskDataDO::getId).eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, BusinessSubSampleDO::getId), BusinessSubSampleExtendRespVO::getAssayTaskCount)

View File

@@ -13,6 +13,7 @@ import com.yomahub.liteflow.core.NodeComponent;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.zt.plat.framework.common.exception.ServiceException; import com.zt.plat.framework.common.exception.ServiceException;
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayParameterDataDO; 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.BusinessAssayProjectDataDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayReportDataDO;
@@ -68,7 +69,9 @@ import com.zt.plat.module.qms.core.sampleflow.SampleFlowDefinition;
import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode; import com.zt.plat.module.qms.core.sampleflow.SampleFlowNode;
import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.module.qms.enums.QmsCommonConstant;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据") @LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
public class SampleEntrustGenSampleDataCmp extends NodeComponent { public class SampleEntrustGenSampleDataCmp extends NodeComponent {
@@ -618,27 +621,35 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
businessSampleAssayResultMapper.updateBatch(sampleAssayResultList); businessSampleAssayResultMapper.updateBatch(sampleAssayResultList);
} }
if (CollUtil.isNotEmpty(businessBaseSampleDOList)) { if (CollUtil.isNotEmpty(businessBaseSampleDOList)) {
log.info("插入 businessBaseSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessBaseSampleMapper.insertBatch(businessBaseSampleDOList); businessBaseSampleMapper.insertBatch(businessBaseSampleDOList);
} }
if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) { if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) {
log.info("插入 businessSubParentSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList); businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList);
} }
if (CollUtil.isNotEmpty(businessSubSampleDOList)) { if (CollUtil.isNotEmpty(businessSubSampleDOList)) {
log.info("插入 businessSubSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessSubSampleMapper.insertBatch(businessSubSampleDOList); businessSubSampleMapper.insertBatch(businessSubSampleDOList);
} }
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) { if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
log.info("插入 businessSubSampleAnalysisGroupDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList); businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList);
} }
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) { if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
log.info("插入 businessAssayTaskDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList); businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
} }
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) { if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
log.info("插入 businessAssayProjectDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList); businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList);
} }
if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) { if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) {
log.info("插入 businessAssayParameterDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList); businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList);
} }
if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) { if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) {
log.info("插入 businessAssayReportDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList); businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList);
} }
} }

View File

@@ -28,6 +28,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent {
String simpleCodeRule = configSubSample.getSimpleCodeRule(); String simpleCodeRule = configSubSample.getSimpleCodeRule();
String simpleCode = sequenceUtil.genCode(simpleCodeRule); String simpleCode = sequenceUtil.genCode(simpleCodeRule);
businessSubSampleDO.setSampleAssayCode(simpleCode); businessSubSampleDO.setSampleAssayCode(simpleCode);
businessSubSampleDO.setSampleReturnCode(simpleCode);
} }
} }

View File

@@ -16,6 +16,7 @@ import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.framework.security.core.LoginUser; import com.zt.plat.framework.security.core.LoginUser;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils; import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; 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.convertList;
@@ -88,10 +89,7 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe
@Override @Override
public List<BusinessAssayTaskDataGroupRespVO> getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) { public List<BusinessAssayTaskDataGroupRespVO> getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) {
//当前登录用户 System.out.println("查询时租户id" + TenantContextHolder.getTenantId());
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//设置当前登录用户的部门id
reqVO.setAssayDepartmentId(loginUser.getVisitDeptId());
return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO); return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO);
} }

View File

@@ -67,12 +67,19 @@ public interface BusinessSubSampleService {
*/ */
PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO); PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO);
/**
* 获取子样分析班组分页
* @param pageReqVO
* @return
*/
PageResult<BusinessSubSampleExtendRespVO> getAnalysisGroupPage(BusinessSubSamplePageReqVO pageReqVO);
/** /**
* 获得子样业务列表 * 获得子样业务列表
* @param reqVO 查询 * @param reqVO 查询
* @return 子样业务列表 * @return 子样业务列表
*/ */
List<BusinessSubSampleExtendRespVO> getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO); List<BusinessSubSampleExtendRespVO> getBusinessSubSampleList(BusinessSubSampleReqVO reqVO);
/** /**
* 根据样品编号及样品流程节点获取样品信息 * 根据样品编号及样品流程节点获取样品信息

View File

@@ -9,6 +9,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessHandoverRecordSubDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleHandoverDetailDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAnalysisGroupDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService; import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService; import com.zt.plat.module.qms.common.dic.service.DictionaryBusinessService;
@@ -25,6 +26,8 @@ import org.springframework.validation.annotation.Validated;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.common.util.object.BeanUtils; import com.zt.plat.framework.common.util.object.BeanUtils;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
@@ -132,15 +135,48 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
@Override @Override
public PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) { public PageResult<BusinessSubSampleExtendRespVO> getBusinessSubSamplePage(BusinessSubSamplePageReqVO pageReqVO) {
PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectPage(pageReqVO); PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectPage(pageReqVO);
if (QmsCommonConstant.FLOW_NODE_TEAM_RECEIVE.equals(pageReqVO.getSampleFlowNodeKey())) {//如果是班组收样 List<BusinessSubSampleExtendRespVO> list = page.getList();
if (CollUtil.isNotEmpty(list)) {
List<Long> subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList);
for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) {
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList());
businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class));
}
} }
return page; return page;
} }
@Override @Override
public List<BusinessSubSampleExtendRespVO> getBusinessSubSampleList(@Valid BusinessSubSampleReqVO reqVO) { public PageResult<BusinessSubSampleExtendRespVO> getAnalysisGroupPage(BusinessSubSamplePageReqVO pageReqVO) {
return businessSubSampleMapper.selectList(reqVO); PageResult<BusinessSubSampleExtendRespVO> page = businessSubSampleMapper.selectAnalysisGroupPage(pageReqVO);
List<BusinessSubSampleExtendRespVO> list = page.getList();
if (CollUtil.isNotEmpty(list)) {
List<Long> subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList);
for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) {
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList());
businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class));
}
}
return page;
}
@Override
public List<BusinessSubSampleExtendRespVO> getBusinessSubSampleList(BusinessSubSampleReqVO reqVO) {
List<BusinessSubSampleExtendRespVO> list = businessSubSampleMapper.selectList(reqVO);
if (CollUtil.isNotEmpty(list)) {
List<Long> subSampleIdList = list.stream().map(m -> m.getId()).collect(Collectors.toList());
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupList = businessSubSampleAnalysisGroupMapper.selectByBusinessSubSampleIds(subSampleIdList);
for (BusinessSubSampleExtendRespVO businessSubSampleExtendRespVO : list) {
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList = businessSubSampleAnalysisGroupList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleExtendRespVO.getId())).collect(Collectors.toList());
businessSubSampleExtendRespVO.setBusinessSubSampleAnalysisGroupList(BeanUtils.toBean(businessSubSampleAnalysisGroupDOList, BusinessSubSampleAnalysisGroupRespVO.class));
}
}
return list;
} }
@Override @Override

View File

@@ -28,6 +28,9 @@ public class ConfigSubSamplePageReqVO extends PageParam {
@Schema(description = "子样流程Key,样品流转流程key") @Schema(description = "子样流程Key,样品流转流程key")
private String flowKey; private String flowKey;
@Schema(description = "是否生成新的归库简码,1-是0-否")
private Integer isGenerateSimpleCode;
@Schema(description = "简码规则") @Schema(description = "简码规则")
private String simpleCodeRule; private String simpleCodeRule;
@@ -40,6 +43,9 @@ public class ConfigSubSamplePageReqVO extends PageParam {
@Schema(description = "样品标签打印模版") @Schema(description = "样品标签打印模版")
private String printTemplate; private String printTemplate;
@Schema(description = "样品标签打印份数")
private Integer codePrintQuantity;
@Schema(description = "复检节点") @Schema(description = "复检节点")
private String recheckFlowNodeKey; private String recheckFlowNodeKey;
@@ -49,6 +55,9 @@ public class ConfigSubSamplePageReqVO extends PageParam {
@Schema(description = "样品保存天数") @Schema(description = "样品保存天数")
private Integer sampleSaveDay; private Integer sampleSaveDay;
@Schema(description = "样品库编码,样品最终归属样品库来自T_CFG_WRH_LOC仓库类型是样品库")
private String configWarehouseLocationCode;
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;

View File

@@ -36,6 +36,10 @@ public class ConfigSubSampleRespVO {
@ExcelProperty("子样流程Key,样品流转流程key") @ExcelProperty("子样流程Key,样品流转流程key")
private String flowKey; private String flowKey;
@Schema(description = "是否生成新的归库简码,1-是0-否", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否生成新的归库简码,1-是0-否")
private Integer isGenerateSimpleCode;
@Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("简码规则") @ExcelProperty("简码规则")
private String simpleCodeRule; private String simpleCodeRule;
@@ -51,6 +55,10 @@ public class ConfigSubSampleRespVO {
@Schema(description = "样品标签打印模版") @Schema(description = "样品标签打印模版")
private String printTemplate; private String printTemplate;
@Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("样品标签打印份数")
private Integer codePrintQuantity;
@Schema(description = "复检节点") @Schema(description = "复检节点")
@ExcelProperty("复检节点") @ExcelProperty("复检节点")
private String recheckFlowNodeKey; private String recheckFlowNodeKey;
@@ -63,6 +71,10 @@ public class ConfigSubSampleRespVO {
@ExcelProperty("样品保存天数") @ExcelProperty("样品保存天数")
private Integer sampleSaveDay; private Integer sampleSaveDay;
@Schema(description = "样品库编码,样品最终归属样品库来自T_CFG_WRH_LOC仓库类型是样品库")
@ExcelProperty("样品库编码,样品最终归属样品库来自T_CFG_WRH_LOC仓库类型是样品库")
private String configWarehouseLocationCode;
@Schema(description = "所属部门") @Schema(description = "所属部门")
@ExcelProperty("所属部门") @ExcelProperty("所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;

View File

@@ -32,6 +32,10 @@ public class ConfigSubSampleSaveReqVO {
@NotEmpty(message = "子样流程Key,样品流转流程key不能为空") @NotEmpty(message = "子样流程Key,样品流转流程key不能为空")
private String flowKey; private String flowKey;
@Schema(description = "是否生成新的归库简码,1-是0-否", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否生成新的归库简码,1-是0-否不能为空")
private Integer isGenerateSimpleCode;
@Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "简码规则", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "简码规则不能为空") @NotEmpty(message = "简码规则不能为空")
private String simpleCodeRule; private String simpleCodeRule;
@@ -46,6 +50,10 @@ public class ConfigSubSampleSaveReqVO {
@Schema(description = "样品标签打印模版") @Schema(description = "样品标签打印模版")
private String printTemplate; private String printTemplate;
@Schema(description = "样品标签打印份数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "样品标签打印份数不能为空")
private Integer codePrintQuantity;
@Schema(description = "复检节点") @Schema(description = "复检节点")
private String recheckFlowNodeKey; private String recheckFlowNodeKey;
@@ -57,6 +65,9 @@ public class ConfigSubSampleSaveReqVO {
@NotNull(message = "样品保存天数不能为空") @NotNull(message = "样品保存天数不能为空")
private Integer sampleSaveDay; private Integer sampleSaveDay;
@Schema(description = "样品库编码,样品最终归属样品库来自T_CFG_WRH_LOC仓库类型是样品库")
private String configWarehouseLocationCode;
@Schema(description = "所属部门") @Schema(description = "所属部门")
private String systemDepartmentCode; private String systemDepartmentCode;

View File

@@ -57,6 +57,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO {
@TableField("FLW_KY") @TableField("FLW_KY")
private String flowKey; private String flowKey;
/** /**
* 是否生成新的归库简码,1-是0-否
*/
@TableField("IS_GEN_SMPL_CD")
private Integer isGenerateSimpleCode;
/**
* 简码规则 * 简码规则
*/ */
@TableField("SMPL_CD_RUL") @TableField("SMPL_CD_RUL")
@@ -77,6 +82,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO {
@TableField("PRNT_TMPL") @TableField("PRNT_TMPL")
private String printTemplate; private String printTemplate;
/** /**
* 样品标签打印份数
*/
@TableField("CD_PRNT_QTY")
private Integer codePrintQuantity;
/**
* 复检节点 * 复检节点
*/ */
@TableField("RCHK_FLW_NDE_KY") @TableField("RCHK_FLW_NDE_KY")
@@ -92,6 +102,11 @@ public class ConfigSubSampleDO extends BusinessBaseDO {
@TableField("SMP_SVE_DY") @TableField("SMP_SVE_DY")
private Integer sampleSaveDay; private Integer sampleSaveDay;
/** /**
* 样品库编码,样品最终归属样品库来自T_CFG_WRH_LOC仓库类型是样品库
*/
@TableField("CFG_WRH_LOC_CD")
private String configWarehouseLocationCode;
/**
* 所属部门 * 所属部门
*/ */
@TableField("SYS_DEPT_CD") @TableField("SYS_DEPT_CD")

View File

@@ -23,12 +23,16 @@ public interface ConfigSubSampleMapper extends BaseMapperX<ConfigSubSampleDO> {
.eqIfPresent(ConfigSubSampleDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId()) .eqIfPresent(ConfigSubSampleDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId())
.eqIfPresent(ConfigSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId()) .eqIfPresent(ConfigSubSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
.eqIfPresent(ConfigSubSampleDO::getFlowKey, reqVO.getFlowKey()) .eqIfPresent(ConfigSubSampleDO::getFlowKey, reqVO.getFlowKey())
.eqIfPresent(ConfigSubSampleDO::getIsGenerateSimpleCode, reqVO.getIsGenerateSimpleCode())
.eqIfPresent(ConfigSubSampleDO::getSimpleCodeRule, reqVO.getSimpleCodeRule()) .eqIfPresent(ConfigSubSampleDO::getSimpleCodeRule, reqVO.getSimpleCodeRule())
.eqIfPresent(ConfigSubSampleDO::getCodeRule, reqVO.getCodeRule()) .eqIfPresent(ConfigSubSampleDO::getCodeRule, reqVO.getCodeRule())
.eqIfPresent(ConfigSubSampleDO::getPrintTemplate, reqVO.getPrintTemplate())
.eqIfPresent(ConfigSubSampleDO::getCodePrintQuantity, reqVO.getCodePrintQuantity())
.eqIfPresent(ConfigSubSampleDO::getIsPrint, reqVO.getIsPrint()) .eqIfPresent(ConfigSubSampleDO::getIsPrint, reqVO.getIsPrint())
.eqIfPresent(ConfigSubSampleDO::getRecheckFlowNodeKey, reqVO.getRecheckFlowNodeKey()) .eqIfPresent(ConfigSubSampleDO::getRecheckFlowNodeKey, reqVO.getRecheckFlowNodeKey())
.likeIfPresent(ConfigSubSampleDO::getSampleName, reqVO.getSampleName()) .likeIfPresent(ConfigSubSampleDO::getSampleName, reqVO.getSampleName())
.eqIfPresent(ConfigSubSampleDO::getSampleSaveDay, reqVO.getSampleSaveDay()) .eqIfPresent(ConfigSubSampleDO::getSampleSaveDay, reqVO.getSampleSaveDay())
.eqIfPresent(ConfigSubSampleDO::getConfigWarehouseLocationCode, reqVO.getConfigWarehouseLocationCode())
.eqIfPresent(ConfigSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(ConfigSubSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(ConfigSubSampleDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(ConfigSubSampleDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ConfigSubSampleDO::getRemark, reqVO.getRemark()) .eqIfPresent(ConfigSubSampleDO::getRemark, reqVO.getRemark())

View File

@@ -4,6 +4,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import com.zt.plat.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer; import com.zt.plat.framework.datapermission.core.rule.dept.DeptDataPermissionRuleCustomizer;
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.BusinessSampleEntrustDetailDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
public class DataPermissionConfiguration { public class DataPermissionConfiguration {
@@ -11,8 +16,11 @@ public class DataPermissionConfiguration {
@Bean @Bean
public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() { public DeptDataPermissionRuleCustomizer sysDeptDataPermissionRuleCustomizer() {
return rule -> { return rule -> {
// dept rule.addDeptColumn(BusinessSampleEntrustRegistrationDO.class);
//rule.addUserColumn(AdminUserDO.class, "id"); rule.addDeptColumn(BusinessSampleEntrustDetailDO.class);
rule.addDeptColumn(BusinessSubSampleDO.class);
rule.addDeptColumn(BusinessAssayTaskDO.class);
rule.addDeptColumn(BusinessAssayTaskDataDO.class);
}; };
} }
} }

View File

@@ -19,9 +19,10 @@
LEFT JOIN T_CFG_ASY_MTHD tcam ON LEFT JOIN T_CFG_ASY_MTHD tcam ON
tbatd.CFG_ASY_MTHD_ID = tcam.ID tbatd.CFG_ASY_MTHD_ID = tcam.ID
WHERE WHERE
tbatd.IS_ASN_TSKD = 0 tbatd.DELETED = 0
AND tcam.DELETED = 0
AND tbatd.IS_ASN_TSKD = 0
AND tbatd.IS_RPOD = 0 AND tbatd.IS_RPOD = 0
AND tbatd.DELETED = 0
<if test="reqVO.assayDepartmentId != null and reqVO.assayDepartmentId != ''"> <if test="reqVO.assayDepartmentId != null and reqVO.assayDepartmentId != ''">
AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId} AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId}
</if> </if>