feat:报告编制开发

This commit is contained in:
FCL
2025-10-16 17:07:41 +08:00
parent 0dd61c6867
commit 1773769979
47 changed files with 1692 additions and 1336 deletions

View File

@@ -51,7 +51,7 @@ public interface ErrorCodeConstants {
ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在");
ErrorCode CONFIG_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在");
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
ErrorCode CONFIG_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报告类型配置不存在");
ErrorCode CONFIG_BASE_SAMPLE_NOT_EXISTS = new ErrorCode(1_032_050_000, "主样配置不存在");
ErrorCode CONFIG_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在");
ErrorCode CONFIG_WAREHOUSE_LOCATION_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "样品库位信息不存在");
@@ -100,9 +100,11 @@ public interface ErrorCodeConstants {
ErrorCode BUSINESS_STANDARD_SAMPLE_PROJECT_NOT_EXISTS = new ErrorCode(1_032_100_000, "标准样检测项目业务不存在");
ErrorCode BUSINESS_TEAM_ASSESSMENT_NOT_EXISTS = new ErrorCode(1_032_100_000, "班组判定数据业务不存在");
ErrorCode BUSINESS_DOCUMENT_MAIN_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告业务不存在");
ErrorCode BUSINESS_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在");
//检测报告
ErrorCode REPORT_DOCUMENT_MAIN_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告业务不存在");
ErrorCode REPORT_DOCUMENT_DATA_NOT_EXISTS = new ErrorCode(1_032_100_000, "检测报告明细不存在");
ErrorCode REPORT_DOCUMENT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报告类型配置不存在");
/*=================================resource 资源管理 1_032_150_000 ~ 1_032_199_999 ==================================*/
ErrorCode DEVICE_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "设备_设备信息不存在");

View File

@@ -1,74 +0,0 @@
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.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 检测报告业务新增/修改 Request VO")
@Data
public class BusinessDocumentMainSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23015")
private Long id;
@Schema(description = "流程实例ID", example = "780")
private Long flowInstanceId;
@Schema(description = "报告类型ID", example = "15259")
private Long configDocumentTypeId;
@Schema(description = "流程模型Key")
private String modelKey;
@Schema(description = "流程流水号")
private String flowSerialNumber;
@Schema(description = "当前节点", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "当前节点不能为空")
private String currentNode;
@Schema(description = "报告编号")
private String documentCode;
@Schema(description = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotEmpty(message = "报告类型,【字典】【jy_doc_main_type】化验报告、典型性报告、检测报告不能为空")
private String documentType;
@Schema(description = "报告标题", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "报告标题不能为空")
private String documentTitle;
@Schema(description = "报告配置项", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "报告配置项不能为空")
private String documentConfig;
@Schema(description = "报告签名信息", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "报告签名信息不能为空")
private String documentSignature;
@Schema(description = "报告发起时间")
private LocalDateTime documentStartTime;
@Schema(description = "报告结束时间")
private LocalDateTime documentEndTime;
@Schema(description = "报告表单数据")
private String formData;
@Schema(description = "附件")
private String attachment;
@Schema(description = "状态,【字典】【jy_doc_main_status】待编制、审批中、已结束", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotEmpty(message = "状态,【字典】【jy_doc_main_status】待编制、审批中、已结束不能为空")
private String status;
@Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED)
private String systemDepartmentCode;
@Schema(description = "备注")
private String remark;
}

View File

@@ -1,30 +0,0 @@
package com.zt.plat.module.qms.business.bus.dal.mapper;
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.controller.vo.BusinessDocumentDataPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessDocumentDataDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
/**
* 检测报告明细 Mapper
*
* @author 后台管理
*/
@Mapper
public interface BusinessDocumentDataMapper extends BaseMapperX<BusinessDocumentDataDO> {
default PageResult<BusinessDocumentDataDO> selectPage(BusinessDocumentDataPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessDocumentDataDO>()
.eqIfPresent(BusinessDocumentDataDO::getBusinessDocumentMainId, reqVO.getBusinessDocumentMainId())
.eqIfPresent(BusinessDocumentDataDO::getSourceId, reqVO.getSourceId())
.eqIfPresent(BusinessDocumentDataDO::getDocumentContent, reqVO.getDocumentContent())
.eqIfPresent(BusinessDocumentDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(BusinessDocumentDataDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessDocumentDataDO::getRemark, reqVO.getRemark())
.orderByDesc(BusinessDocumentDataDO::getId));
}
}

View File

@@ -1,42 +0,0 @@
package com.zt.plat.module.qms.business.bus.dal.mapper;
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.controller.vo.BusinessDocumentMainPageReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessDocumentMainDO;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
/**
* 检测报告业务 Mapper
*
* @author 后台管理
*/
@Mapper
public interface BusinessDocumentMainMapper extends BaseMapperX<BusinessDocumentMainDO> {
default PageResult<BusinessDocumentMainDO> selectPage(BusinessDocumentMainPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessDocumentMainDO>()
.eqIfPresent(BusinessDocumentMainDO::getFlowInstanceId, reqVO.getFlowInstanceId())
.eqIfPresent(BusinessDocumentMainDO::getConfigDocumentTypeId, reqVO.getConfigDocumentTypeId())
.eqIfPresent(BusinessDocumentMainDO::getModelKey, reqVO.getModelKey())
.eqIfPresent(BusinessDocumentMainDO::getFlowSerialNumber, reqVO.getFlowSerialNumber())
.eqIfPresent(BusinessDocumentMainDO::getCurrentNode, reqVO.getCurrentNode())
.eqIfPresent(BusinessDocumentMainDO::getDocumentCode, reqVO.getDocumentCode())
.eqIfPresent(BusinessDocumentMainDO::getDocumentType, reqVO.getDocumentType())
.eqIfPresent(BusinessDocumentMainDO::getDocumentTitle, reqVO.getDocumentTitle())
.eqIfPresent(BusinessDocumentMainDO::getDocumentConfig, reqVO.getDocumentConfig())
.eqIfPresent(BusinessDocumentMainDO::getDocumentSignature, reqVO.getDocumentSignature())
.betweenIfPresent(BusinessDocumentMainDO::getDocumentStartTime, reqVO.getDocumentStartTime())
.betweenIfPresent(BusinessDocumentMainDO::getDocumentEndTime, reqVO.getDocumentEndTime())
.eqIfPresent(BusinessDocumentMainDO::getFormData, reqVO.getFormData())
.eqIfPresent(BusinessDocumentMainDO::getAttachment, reqVO.getAttachment())
.eqIfPresent(BusinessDocumentMainDO::getStatus, reqVO.getStatus())
.eqIfPresent(BusinessDocumentMainDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(BusinessDocumentMainDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(BusinessDocumentMainDO::getRemark, reqVO.getRemark())
.orderByDesc(BusinessDocumentMainDO::getId));
}
}

View File

@@ -63,4 +63,7 @@ public interface BusinessAssayReportDataService {
*/
PageResult<BusinessAssayReportDataDO> getBusinessAssayReportDataPage(BusinessAssayReportDataPageReqVO pageReqVO);
List<BusinessAssayReportDataDO> listByIds(List<Long> ids);
}

View File

@@ -90,4 +90,8 @@ public class BusinessAssayReportDataServiceImpl implements BusinessAssayReportDa
return businessAssayReportDataMapper.selectPage(pageReqVO);
}
@Override
public List<BusinessAssayReportDataDO> listByIds(List<Long> ids) {
return businessAssayReportDataMapper.selectByIds(ids);
}
}

View File

@@ -1,66 +0,0 @@
package com.zt.plat.module.qms.business.bus.service;
import java.util.*;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataPageReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataSaveReqVO;
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.BusinessDocumentDataDO;
import com.zt.plat.framework.common.pojo.PageParam;
/**
* 检测报告明细 Service 接口
*
* @author 后台管理
*/
public interface BusinessDocumentDataService {
/**
* 创建检测报告明细
*
* @param createReqVO 创建信息
* @return 编号
*/
BusinessDocumentDataRespVO createBusinessDocumentData(@Valid BusinessDocumentDataSaveReqVO createReqVO);
/**
* 更新检测报告明细
*
* @param updateReqVO 更新信息
*/
void updateBusinessDocumentData(@Valid BusinessDocumentDataSaveReqVO updateReqVO);
/**
* 删除检测报告明细
*
* @param id 编号
*/
void deleteBusinessDocumentData(Long id);
/**
* 批量删除检测报告明细
*
* @param ids 编号
*/
void deleteBusinessDocumentDataListByIds(List<Long> ids);
/**
* 获得检测报告明细
*
* @param id 编号
* @return 检测报告明细
*/
BusinessDocumentDataDO getBusinessDocumentData(Long id);
/**
* 获得检测报告明细分页
*
* @param pageReqVO 分页查询
* @return 检测报告明细分页
*/
PageResult<BusinessDocumentDataDO> getBusinessDocumentDataPage(BusinessDocumentDataPageReqVO pageReqVO);
}

View File

@@ -1,93 +0,0 @@
package com.zt.plat.module.qms.business.bus.service;
import cn.hutool.core.collection.CollUtil;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataPageReqVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataRespVO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessDocumentDataSaveReqVO;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
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.BusinessDocumentDataDO;
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessDocumentDataMapper;
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 BusinessDocumentDataServiceImpl implements BusinessDocumentDataService {
@Resource
private BusinessDocumentDataMapper businessDocumentDataMapper;
@Override
public BusinessDocumentDataRespVO createBusinessDocumentData(BusinessDocumentDataSaveReqVO createReqVO) {
// 插入
BusinessDocumentDataDO businessDocumentData = BeanUtils.toBean(createReqVO, BusinessDocumentDataDO.class);
businessDocumentDataMapper.insert(businessDocumentData);
// 返回
return BeanUtils.toBean(businessDocumentData, BusinessDocumentDataRespVO.class);
}
@Override
public void updateBusinessDocumentData(BusinessDocumentDataSaveReqVO updateReqVO) {
// 校验存在
validateBusinessDocumentDataExists(updateReqVO.getId());
// 更新
BusinessDocumentDataDO updateObj = BeanUtils.toBean(updateReqVO, BusinessDocumentDataDO.class);
businessDocumentDataMapper.updateById(updateObj);
}
@Override
public void deleteBusinessDocumentData(Long id) {
// 校验存在
validateBusinessDocumentDataExists(id);
// 删除
businessDocumentDataMapper.deleteById(id);
}
@Override
public void deleteBusinessDocumentDataListByIds(List<Long> ids) {
// 校验存在
validateBusinessDocumentDataExists(ids);
// 删除
businessDocumentDataMapper.deleteByIds(ids);
}
private void validateBusinessDocumentDataExists(List<Long> ids) {
List<BusinessDocumentDataDO> list = businessDocumentDataMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(BUSINESS_DOCUMENT_DATA_NOT_EXISTS);
}
}
private void validateBusinessDocumentDataExists(Long id) {
if (businessDocumentDataMapper.selectById(id) == null) {
throw exception(BUSINESS_DOCUMENT_DATA_NOT_EXISTS);
}
}
@Override
public BusinessDocumentDataDO getBusinessDocumentData(Long id) {
return businessDocumentDataMapper.selectById(id);
}
@Override
public PageResult<BusinessDocumentDataDO> getBusinessDocumentDataPage(BusinessDocumentDataPageReqVO pageReqVO) {
return businessDocumentDataMapper.selectPage(pageReqVO);
}
}

Some files were not shown because too many files have changed in this diff Show More