Compare commits
1 Commits
lims_dev
...
04596350b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 04596350b6 |
@@ -54,6 +54,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONFIG_REPORT_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "报表类型配置不存在");
|
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_PROJECT_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测项目配置不存在");
|
||||||
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
|
ErrorCode CONFIG_ENTRUST_SOURCE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源配置不存在");
|
||||||
|
ErrorCode CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS = new ErrorCode(1_032_050_000, "检验委托来源与样品类型配置不存在");
|
||||||
|
|
||||||
ErrorCode CONFIG_BASE_SAMPLE_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_ASSAY_METHOD_PROJECT_PARAMETER_NOT_EXISTS = new ErrorCode(1_032_050_000, "检测方法分析项目参数配置不存在");
|
||||||
@@ -149,9 +150,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
ErrorCode MATERIAL_INFOMATION_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材不存在");
|
||||||
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
ErrorCode MATERIAL_PRODUCT_NOT_EXISTS = new ErrorCode(1_032_150_000, "试剂耗材大类不存在");
|
||||||
|
|
||||||
ErrorCode MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程明细不存在");
|
|
||||||
ErrorCode MATERIAL_LIFECYCLE_NOT_EXISTS = new ErrorCode(1_032_150_000, "物料通用流程不存在");
|
|
||||||
|
|
||||||
|
|
||||||
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
/*================================= tx 1_032_200_000 ~ 1_032_249_999 ==================================*/
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,15 @@ public interface QmsCommonConstant {
|
|||||||
/** 检验委托 **/
|
/** 检验委托 **/
|
||||||
String ENTRUST_INSPECTION = "entrust_inspection";
|
String ENTRUST_INSPECTION = "entrust_inspection";
|
||||||
|
|
||||||
|
/** 委托样品类型: 委检样 **/
|
||||||
|
String ENTRUST_COMMISSION_INSPECTION_SAMPLE = "commissionInspectionSample";
|
||||||
|
|
||||||
|
/** 委托样品类型: 商检分析样 **/
|
||||||
|
String ENTRUST_INSPECTION_ANALYSIS_SAMPLE = "inspectionAnalysisSample";
|
||||||
|
|
||||||
|
/** 委托样品类型: 商检综合 **/
|
||||||
|
String ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE = "comprehensiveInspectionSample";
|
||||||
|
|
||||||
/** 中心收样 **/
|
/** 中心收样 **/
|
||||||
String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive";
|
String FLOW_NODE_CENTER_RECEIVE = "flw_center_receive";
|
||||||
|
|
||||||
@@ -179,6 +188,10 @@ public interface QmsCommonConstant {
|
|||||||
/** 检验完成状态-未完成 **/
|
/** 检验完成状态-未完成 **/
|
||||||
String UNCHECKED = "unchecked";
|
String UNCHECKED = "unchecked";
|
||||||
|
|
||||||
|
/** 数据回报状态 未回报 **/
|
||||||
|
String UNRETURNED = "unreturned";
|
||||||
|
|
||||||
|
|
||||||
/** 自动 **/
|
/** 自动 **/
|
||||||
String AUTOMATIC = "automatic";
|
String AUTOMATIC = "automatic";
|
||||||
|
|
||||||
@@ -194,4 +207,7 @@ public interface QmsCommonConstant {
|
|||||||
|
|
||||||
/** 允许提交 **/
|
/** 允许提交 **/
|
||||||
String ALLOW_SUBMIT = "allow_submit";
|
String ALLOW_SUBMIT = "allow_submit";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,15 @@ import java.util.stream.Collectors;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||||
import com.yomahub.liteflow.core.NodeComponent;
|
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;
|
||||||
@@ -46,11 +48,11 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmen
|
|||||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
import com.zt.plat.module.qms.business.bus.liteflow.param.SampleFlowInfo;
|
||||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectExtendRespVO;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfAdd;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleMethodConfInfo;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
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.ConfigAssayMethodProjectParameterDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSampleFlowDO;
|
||||||
@@ -79,6 +81,13 @@ import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委检样 是否有来样品位S值, 是: 综合分析室分析配料元素,试金分析室获取分析的配料元素 ;否:不送往综合分析室,配料时采用来样品位S值,如果是必须含有Cu、S的,则试金分析人员称样时,估一个Cu品位进行配料。
|
||||||
|
*
|
||||||
|
* 商检分析样 这批样中第一个样品默认产生1个配料任务(综合分析室分析),最终这些配料元素对应到这批商检分析样的每一个试金样品的配料参数上;
|
||||||
|
*
|
||||||
|
* 商检综合样 综合样,除了杂质元素,如果要分析Au、Ag,单个样品综合分析室分析配料元素会单独生成1个任务;这个结果匹配到综合样自身的试金任务的配料参数上;
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
|
@LiteflowComponent(id = "sampleEntrustGenSampleDataCmp", name = "样品委托生成系统样品数据")
|
||||||
public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||||
@@ -182,47 +191,33 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//样品来样品位
|
//样品来样品位
|
||||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
||||||
|
|
||||||
//金银检测项目字典id列表
|
List<Long> baseSampleIdList = sampleEntrustDetailList.stream().map(m -> m.getBaseSampleId()).distinct().collect(Collectors.toList());
|
||||||
// List<Long> auAgDictionaryProjectIdList = new ArrayList<>() {
|
|
||||||
// private static final long serialVersionUID = 1L;
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// add(1000000000000000002L);
|
|
||||||
// add(1000000000000000003L);
|
|
||||||
// }};
|
|
||||||
//硫的检测项目字典id
|
|
||||||
// Long sDictionaryProjectId = 1000000000000000004L;
|
|
||||||
|
|
||||||
//商检样品来源id
|
|
||||||
// List<Long> sjEntrustSourceIdList = new ArrayList<>() {
|
|
||||||
// private static final long serialVersionUID = 1L;
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// add(1000000000000000002L);//中铜国贸
|
|
||||||
// }};
|
|
||||||
|
|
||||||
//样品大类列表
|
//样品大类列表
|
||||||
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectList();
|
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectByIds(baseSampleIdList);
|
||||||
|
|
||||||
//主样配置
|
//主样配置
|
||||||
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectList();
|
List<ConfigBaseSampleDO> configBaseSampleList = configBaseSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
|
List<Long> configBaseSampleIdList = configBaseSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//分样配置
|
//分样配置
|
||||||
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectList();
|
List<ConfigSubSampleParentDO> configSubSampleParentList = configSubSampleParentMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
//子样配置
|
//子样配置
|
||||||
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectList();
|
List<ConfigSubSampleDO> configSubSampleList = configSubSampleMapper.selectByBaseSampleIds(baseSampleIdList);
|
||||||
|
List<Long> configSubSampleIdList = configSubSampleList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||||
//子样分析方法配置
|
//子样分析方法配置
|
||||||
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectList();
|
List<ConfigSubSampleMethodDO> configSubSampleMethodList = configSubSampleMethodMapper.selectByConfigSubSampleIds(configSubSampleIdList);
|
||||||
|
List<Long> configAssayMethodIdList = configSubSampleMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
//分析方法配置
|
//分析方法配置
|
||||||
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectList();
|
List<ConfigAssayMethodDO> configAssayMethodList = configAssayMethodMapper.selectByIds(configAssayMethodIdList);
|
||||||
//分析方法检测项目配置
|
//分析方法检测项目配置
|
||||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectList();
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList = configAssayMethodProjectMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||||
//分析方法检测项目参数配置
|
//分析方法检测项目参数配置
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectList();
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList = configAssayMethodProjectParameterMapper.selectByConfigAssayMethodIds(configAssayMethodIdList);
|
||||||
//检测项目字典
|
//检测项目字典
|
||||||
List<DictionaryProjectDO> dictionaryProjectList = dictionaryProjectMapper.selectList();
|
List<DictionaryProjectDO> dictionaryProjectList = dictionaryProjectMapper.selectList();
|
||||||
|
|
||||||
//主样报表配置
|
//主样报表配置
|
||||||
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectList();
|
List<ConfigSampleReportDO> configSampleReportList = configSampleReportMapper.selectByConfigBaseSampleIds(configBaseSampleIdList);
|
||||||
|
|
||||||
//样品流程配置
|
//样品流程配置
|
||||||
List<String> configSampleFlowKeyList = new ArrayList<>();
|
List<String> configSampleFlowKeyList = new ArrayList<>();
|
||||||
@@ -253,13 +248,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//分析报表数据
|
//分析报表数据
|
||||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
||||||
|
|
||||||
//是否为商检委托
|
|
||||||
// Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId());
|
|
||||||
//是否分析金银
|
|
||||||
// Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId()));
|
|
||||||
//是否分析硫
|
|
||||||
// Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId));
|
|
||||||
|
|
||||||
//子样流转信息列表
|
//子样流转信息列表
|
||||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
||||||
|
|
||||||
@@ -267,11 +255,19 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList());
|
List<BusinessSampleEntrustDetailDO> sampleEntrustDetailListSort = sampleEntrustDetailList.stream().sorted(Comparator.comparingInt(BusinessSampleEntrustDetailDO::getSort)).collect(Collectors.toList());
|
||||||
//主样
|
//主样
|
||||||
BusinessBaseSampleDO businessBaseSampleDO = null;
|
BusinessBaseSampleDO businessBaseSampleDO = null;
|
||||||
int sort = 0;//委托明细顺序
|
int sjfxyOne = -1;//商检分析样第一个是值为0,已经过商检分析样的值为1,默认值为-1;
|
||||||
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细
|
for (BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO : sampleEntrustDetailListSort) {//委托样品明细
|
||||||
|
|
||||||
//样品大类
|
//样品大类
|
||||||
BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null);
|
BaseSampleDO baseSampleDO = baseSampleList.stream().filter(f -> f.getId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey())){//如果是商检分析样
|
||||||
|
if (sjfxyOne == -1) {
|
||||||
|
sjfxyOne = 0;//第一个商检分析样
|
||||||
|
} else {
|
||||||
|
sjfxyOne = 1;//商检分析样已添加过
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//获取当前样品的检测项目
|
//获取当前样品的检测项目
|
||||||
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList());
|
List<BusinessSampleEntrustProjectDO> sampleEntrustProjectDOList = sampleEntrustProjectList.stream().filter(f -> businessSampleEntrustDetailDO.getId().equals(f.getBusinessSampleEntrustDetailId())).collect(Collectors.toList());
|
||||||
@@ -286,42 +282,17 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<MaterialAssayStandardMethodDO> materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList);
|
List<MaterialAssayStandardMethodDO> materialAssayStandardMethodList = sampleEntrustContext.getMaterialAssayStandardMethodDefaultByMaterialAssayStandardDetailIds(materialAssayStandardDetailIdList);
|
||||||
|
|
||||||
//获取检测方法
|
//获取检测方法
|
||||||
List<Long> configAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
List<Long> materialAssayStandardConfigAssayMethodIdList = materialAssayStandardMethodList.stream().map(m -> m.getConfigAssayMethodId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//查找子样配置
|
//查找当前委托明细分析的子样配置
|
||||||
List<Long> configSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && configAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
List<Long> currentConfigSubSampleIdList = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && materialAssayStandardConfigAssayMethodIdList.contains(f.getConfigAssayMethodId())).map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
//查询当前委托样品对应的子样
|
//查询当前委托样品对应的子样
|
||||||
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> configSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
List<ConfigSubSampleDO> entrustConfigSubSampleList = configSubSampleList.stream().filter(f -> currentConfigSubSampleIdList.contains(f.getId()) && f.getBaseSampleId().equals(businessSampleEntrustDetailDO.getBaseSampleId())).distinct().collect(Collectors.toList());
|
||||||
if (entrustConfigSubSampleList.size() != 1) {
|
if (entrustConfigSubSampleList.size() != 1) {
|
||||||
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
throw new ServiceException(1_032_100_000, "子样配置不正确");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//是否创建综合样S分析
|
|
||||||
// Boolean isCreateZhy = false;
|
|
||||||
//综合样分析方法
|
|
||||||
// ConfigAssayMethodDO configAssayMethodZhy = null;
|
|
||||||
|
|
||||||
//是商检样品,分析金银,第一个样品
|
|
||||||
// if (isSjEntrust && isAssayAuAg && sort == 0) {
|
|
||||||
//是否分析硫
|
|
||||||
// isAssayS = dictionaryProjectIdList.contains(sDictionaryProjectId);
|
|
||||||
// if (isAssayS) {
|
|
||||||
// isCreateZhy = false;
|
|
||||||
// } else {
|
|
||||||
// isCreateZhy = true;
|
|
||||||
// MaterialAssayStandardMethodDO materialAssayStandardMethodDO = materialAssayStandardMethodMapper.selectByBaseSampleIdAndDictionaryProjectId(businessSampleEntrustDetailDO.getBaseSampleId(), sDictionaryProjectId);
|
|
||||||
// if (materialAssayStandardMethodDO == null) {
|
|
||||||
// throw new ServiceException(1_032_100_000, "商检样品,检测项目存在金银,但未找到S配置");
|
|
||||||
// }
|
|
||||||
// configAssayMethodZhy = configAssayMethodMapper.selectById(materialAssayStandardMethodDO.getConfigAssayMethodId());
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//获取到子样配置
|
//获取到子样配置
|
||||||
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
ConfigSubSampleDO configSubSample = entrustConfigSubSampleList.get(0);
|
||||||
Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId();
|
Long configSubSampleParentId = configSubSample.getConfigSubSampleParentId();
|
||||||
@@ -437,7 +408,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
//子样对应的分析班组
|
//子样对应的分析班组
|
||||||
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null;
|
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO = null;
|
||||||
|
|
||||||
for (Long configAssayMethodId : configAssayMethodIdList) {
|
for (Long configAssayMethodId : materialAssayStandardConfigAssayMethodIdList) {
|
||||||
//查询分析方法
|
//查询分析方法
|
||||||
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null);
|
ConfigAssayMethodDO configAssayMethodDO = configAssayMethodList.stream().filter(f -> f.getId().equals(configAssayMethodId)).findFirst().orElse(null);
|
||||||
|
|
||||||
@@ -456,128 +427,52 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
List<Long> projectIdList = addAssayTask.getProjectIdList();
|
List<Long> projectIdList = addAssayTask.getProjectIdList();
|
||||||
//判定检测项目包含条件中的检测项目
|
//判定检测项目包含条件中的检测项目
|
||||||
Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId()));
|
Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId()));
|
||||||
if (isAssayConditionProjectList && sort == 0) {
|
//是否预报S值
|
||||||
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
Boolean isForecastS = false;
|
||||||
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();
|
||||||
|
if (StringUtils.isNotBlank(forecastResult)) {
|
||||||
//查询子样对应的分析方法
|
JSONArray array = JSON.parseArray(forecastResult);
|
||||||
ConfigSubSampleMethodDO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
for (int i = 0; i < array.size(); i++) {
|
||||||
|
JSONObject item = array.getJSONObject(i);
|
||||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
if ("S".equals(item.getString("simpleName"))) {
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
isForecastS = true;
|
||||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
break;
|
||||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
|
||||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
|
||||||
|
|
||||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
//根据任务数判断是平行还是
|
|
||||||
String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
|
||||||
|
|
||||||
//分样判定数据
|
|
||||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
|
||||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
|
||||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
|
||||||
|
|
||||||
//子样判定数据
|
|
||||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
|
||||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
|
||||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
|
||||||
|
|
||||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
|
||||||
|
|
||||||
//根据检测方法循环
|
|
||||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
|
||||||
//根据任务数循环
|
|
||||||
for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.getTaskCount(); i++) {
|
|
||||||
//子样检测任务
|
|
||||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
|
||||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
|
||||||
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
|
||||||
businessAssayTaskDataDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
|
||||||
businessAssayTaskDataDO.setAssayType(assayType);
|
|
||||||
businessAssayTaskDataDO.setTaskType("常规");
|
|
||||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
|
||||||
|
|
||||||
for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
|
||||||
|
|
||||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
|
||||||
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
|
||||||
assayProjectBuilder.append(dictionaryProject.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.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
|
||||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
|
||||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
|
||||||
|
|
||||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList());
|
|
||||||
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());
|
|
||||||
|
|
||||||
|
|
||||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
|
||||||
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
|
||||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果是商检样分析,且为第一个商检分析样,并且包含要检测的项目,
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION_ANALYSIS_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && sjfxyOne == 0) {
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMPREHENSIVE_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList) {//如果是商检综合样,并且包含需检查的项目
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
|
|
||||||
|
} else if (QmsCommonConstant.ENTRUST_COMMISSION_INSPECTION_SAMPLE.equals(baseSampleDO.getDictionaryBusinessKey()) && isAssayConditionProjectList && !isForecastS ) {//如果是委检样,包含检测项目,未预报S值
|
||||||
|
addAssayTask(currentDateTime, configSubSampleMethodList, configAssayMethodProjectList,
|
||||||
|
configAssayMethodProjectParameterList, dictionaryProjectList,
|
||||||
|
businessSubParentSampleAssessmentDOList, businessSubSampleAnalysisGroupDOList,
|
||||||
|
businessSubSampleAssessmentDOList, businessAssayTaskDataDOList,
|
||||||
|
businessAssayProjectDataDOList, businessAssayParameterDataDOList, configSubSample,
|
||||||
|
configSampleFlowSub, sampleFlowNodeSub, businessSubSampleDO, methodId,
|
||||||
|
projectIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//分析班组
|
||||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
if (businessSubSampleAnalysisGroupDO == null) {
|
||||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||||
@@ -638,11 +533,11 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodDO.getAssayDepartmentName());
|
||||||
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectDO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
StringBuilder assayProjectBuilder = new StringBuilder();
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
for (ConfigAssayMethodProjectDO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
if (!dictionaryProjectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
@@ -661,9 +556,6 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||||
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_REPORT);
|
||||||
// if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值
|
|
||||||
// businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT);
|
|
||||||
// }
|
|
||||||
|
|
||||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
businessAssayProjectDataDO.setIsEnabled(1);
|
||||||
@@ -693,119 +585,11 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
//判定是商检 分析金银 需要创建综合样,样品为第1个
|
|
||||||
if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) {
|
|
||||||
Long configAssayMethodIdZhy = configAssayMethodZhy.getId();
|
|
||||||
Long assayDepartmentIdZhy = configAssayMethodZhy.getAssayDepartmentId();
|
|
||||||
|
|
||||||
//查询子样对应的分析方法
|
|
||||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
|
||||||
|
|
||||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(assayDepartmentIdZhy)).findFirst().orElse(null);
|
|
||||||
if (businessSubSampleAnalysisGroupDO == null) {
|
|
||||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
|
||||||
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
|
||||||
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
|
||||||
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
|
||||||
|
|
||||||
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
//根据任务数判断是平行还是
|
|
||||||
String assayType = configSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
|
||||||
|
|
||||||
//分样判定数据
|
|
||||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
|
||||||
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
|
||||||
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
|
||||||
|
|
||||||
//子样判定数据
|
|
||||||
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
|
||||||
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
|
||||||
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
|
||||||
businessSubSampleAssessmentDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessSubSampleAssessmentDO.setAssayType(assayType);
|
|
||||||
businessSubSampleAssessmentDO.setTaskType("常规");
|
|
||||||
|
|
||||||
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
|
||||||
|
|
||||||
//根据检测方法循环
|
|
||||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
|
||||||
//根据任务数循环
|
|
||||||
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.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
|
||||||
businessAssayTaskDataDO.setConfigAssayMethodId(configAssayMethodZhy.getId());
|
|
||||||
businessAssayTaskDataDO.setAssayType(assayType);
|
|
||||||
businessAssayTaskDataDO.setTaskType("常规");
|
|
||||||
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
|
||||||
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentId(configAssayMethodZhy.getAssayDepartmentId());
|
|
||||||
businessAssayTaskDataDO.setAssayDepartmentName(configAssayMethodZhy.getAssayDepartmentName());
|
|
||||||
|
|
||||||
|
|
||||||
//查询S检测项目
|
|
||||||
ConfigAssayMethodProjectDO configAssayMethodProjectDO = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(configAssayMethodIdZhy) && f.getDictionaryProjectId().equals(sDictionaryProjectId)).findFirst().orElse(null);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//检测项目
|
|
||||||
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.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
|
||||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
|
||||||
businessAssayProjectDataDO.setIsEnabled(1);
|
|
||||||
businessAssayProjectDataDO.setIsNotAssessment(0);
|
|
||||||
|
|
||||||
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
|
||||||
|
|
||||||
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList());
|
|
||||||
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());
|
|
||||||
|
|
||||||
|
|
||||||
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
|
||||||
}
|
|
||||||
|
|
||||||
businessAssayTaskDataDO.setAssayProject("S");
|
|
||||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
**/
|
|
||||||
sort++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED);
|
sampleEntrustRegistration.setRegistrationStatus(QmsCommonConstant.SUBMITTED);
|
||||||
|
sampleEntrustRegistration.setAssayStatus(QmsCommonConstant.UNCHECKED);
|
||||||
|
sampleEntrustRegistration.setDataStatus(QmsCommonConstant.UNRETURNED);
|
||||||
|
|
||||||
sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList);
|
sampleEntrustContext.setSampleFlowInfoList(sampleFlowInfoList);
|
||||||
|
|
||||||
@@ -838,6 +622,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList);
|
businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
||||||
|
sampleEntrustRegistration.setTaskQuantity(businessAssayTaskDataDOList.size());
|
||||||
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
||||||
@@ -851,4 +636,133 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addAssayTask(LocalDateTime currentDateTime, List<ConfigSubSampleMethodDO> configSubSampleMethodList,
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectList,
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterList,
|
||||||
|
List<DictionaryProjectDO> dictionaryProjectList,
|
||||||
|
List<BusinessSubParentSampleAssessmentDO> businessSubParentSampleAssessmentDOList,
|
||||||
|
List<BusinessSubSampleAnalysisGroupDO> businessSubSampleAnalysisGroupDOList,
|
||||||
|
List<BusinessSubSampleAssessmentDO> businessSubSampleAssessmentDOList,
|
||||||
|
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList,
|
||||||
|
List<BusinessAssayProjectDataDO> businessAssayProjectDataDOList,
|
||||||
|
List<BusinessAssayParameterDataDO> businessAssayParameterDataDOList, ConfigSubSampleDO configSubSample,
|
||||||
|
ConfigSampleFlowDO configSampleFlowSub, SampleFlowNode sampleFlowNodeSub,
|
||||||
|
BusinessSubSampleDO businessSubSampleDO, Long methodId, List<Long> projectIdList) {
|
||||||
|
BusinessSubSampleAnalysisGroupDO businessSubSampleAnalysisGroupDO;
|
||||||
|
ConfigAssayMethodDO addAssayTaskConfigAssayMethod = configAssayMethodMapper.selectById(methodId);
|
||||||
|
Long addAssayTaskAssayDepartmentId = addAssayTaskConfigAssayMethod.getAssayDepartmentId();
|
||||||
|
|
||||||
|
//查询子样对应的分析方法
|
||||||
|
ConfigSubSampleMethodDO addAssayTaskConfigSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(methodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||||
|
|
||||||
|
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(addAssayTaskAssayDepartmentId)).findFirst().orElse(null);
|
||||||
|
if (businessSubSampleAnalysisGroupDO == null) {
|
||||||
|
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||||
|
businessSubSampleAnalysisGroupDO.setId(IdWorker.getId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||||
|
businessSubSampleAnalysisGroupDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||||
|
businessSubSampleAnalysisGroupDO.setSampleStatus("待收样");
|
||||||
|
|
||||||
|
businessSubSampleAnalysisGroupDOList.add(businessSubSampleAnalysisGroupDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据任务数判断是平行还是
|
||||||
|
String assayType = addAssayTaskConfigSubSampleMethodDO.getTaskCount() > 1 ? QmsCommonConstant.ASSAY_TYPE_SINGLE_PARALLEL : QmsCommonConstant.ASSAY_TYPE_SINGLE_CUP;
|
||||||
|
|
||||||
|
//分样判定数据
|
||||||
|
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessmentDO = new BusinessSubParentSampleAssessmentDO();
|
||||||
|
businessSubParentSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubParentSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubParentSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessSubParentSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubParentSampleAssessmentDO.setTaskType("常规");
|
||||||
|
businessSubParentSampleAssessmentDOList.add(businessSubParentSampleAssessmentDO);
|
||||||
|
|
||||||
|
//子样判定数据
|
||||||
|
BusinessSubSampleAssessmentDO businessSubSampleAssessmentDO = new BusinessSubSampleAssessmentDO();
|
||||||
|
businessSubSampleAssessmentDO.setId(IdWorker.getId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubParentSampleAssessmentId(businessSubParentSampleAssessmentDO.getId());
|
||||||
|
businessSubSampleAssessmentDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessSubSampleAssessmentDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessSubSampleAssessmentDO.setAssayType(assayType);
|
||||||
|
businessSubSampleAssessmentDO.setTaskType("常规");
|
||||||
|
|
||||||
|
businessSubSampleAssessmentDOList.add(businessSubSampleAssessmentDO);
|
||||||
|
|
||||||
|
//根据检测方法循环
|
||||||
|
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||||
|
//根据任务数循环
|
||||||
|
for (int i = 0; i < addAssayTaskConfigSubSampleMethodDO.getTaskCount(); i++) {
|
||||||
|
//子样检测任务
|
||||||
|
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||||
|
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||||
|
businessAssayTaskDataDO.setBusinessBaseSampleId(businessSubSampleDO.getBusinessBaseSampleId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubParentSampleId(businessSubSampleDO.getBusinessSubParentSampleId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubSampleId(businessSubSampleDO.getId());
|
||||||
|
businessAssayTaskDataDO.setBusinessSubSampleAssessmentId(businessSubSampleAssessmentDO.getId());//子样判定id
|
||||||
|
businessAssayTaskDataDO.setConfigAssayMethodId(addAssayTaskConfigAssayMethod.getId());
|
||||||
|
businessAssayTaskDataDO.setAssayType(assayType);
|
||||||
|
businessAssayTaskDataDO.setTaskType("常规");
|
||||||
|
businessAssayTaskDataDO.setConfigSampleFlowId(configSampleFlowSub.getId());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeKey(sampleFlowNodeSub.getNodeKey());
|
||||||
|
businessAssayTaskDataDO.setSampleFlowNodeTime(currentDateTime);
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentId(addAssayTaskConfigAssayMethod.getAssayDepartmentId());
|
||||||
|
businessAssayTaskDataDO.setAssayDepartmentName(addAssayTaskConfigAssayMethod.getAssayDepartmentName());
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectExtendRespVO> configAssayMethodProjectDOList = configAssayMethodProjectList.stream().filter(f -> f.getConfigAssayMethodId().equals(methodId)).collect(Collectors.toList());
|
||||||
|
|
||||||
|
StringBuilder assayProjectBuilder = new StringBuilder();
|
||||||
|
|
||||||
|
for (ConfigAssayMethodProjectExtendRespVO configAssayMethodProjectDO : configAssayMethodProjectDOList) {
|
||||||
|
|
||||||
|
//如果当前分析方法的项目不在当前检测项目中,则跳出循环继续
|
||||||
|
if (!projectIdList.contains(configAssayMethodProjectDO.getDictionaryProjectId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
DictionaryProjectDO dictionaryProject = dictionaryProjectList.stream().filter(f -> f.getId().equals(configAssayMethodProjectDO.getDictionaryProjectId())).findFirst().orElse(null);
|
||||||
|
assayProjectBuilder.append(dictionaryProject.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.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT);
|
||||||
|
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||||
|
businessAssayProjectDataDO.setIsEnabled(1);
|
||||||
|
businessAssayProjectDataDO.setIsNotAssessment(0);
|
||||||
|
|
||||||
|
businessAssayProjectDataDOList.add(businessAssayProjectDataDO);
|
||||||
|
|
||||||
|
List<ConfigAssayMethodProjectParameterDO> configAssayMethodProjectParameterDOList = configAssayMethodProjectParameterList.stream().filter(f -> f.getConfigAssayMethodProjectId().equals(configAssayMethodProjectDO.getId())).collect(Collectors.toList());
|
||||||
|
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());
|
||||||
|
|
||||||
|
|
||||||
|
businessAssayParameterDataDOList.add(businessAssayParameterDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assayProjectBuilder.delete(assayProjectBuilder.length() - 1 , assayProjectBuilder.length());
|
||||||
|
businessAssayTaskDataDO.setAssayProject(assayProjectBuilder.toString());
|
||||||
|
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,13 @@ public class BaseSampleController implements BusinessControllerMarker {
|
|||||||
PageResult<BaseSampleDO> pageResult = baseSampleService.getBaseSamplePage(pageReqVO);
|
PageResult<BaseSampleDO> pageResult = baseSampleService.getBaseSamplePage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class));
|
return success(BeanUtils.toBean(pageResult, BaseSampleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "获得样品大类管理列表")
|
||||||
|
public CommonResult<?> getBaseSampleList(BaseSamplePageReqVO reqVO) {
|
||||||
|
List<BaseSampleRespVO> list = baseSampleService.getBaseSampleList(reqVO);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出样品大类管理 Excel")
|
@Operation(summary = "导出样品大类管理 Excel")
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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.config.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.service.ConfigEntrustSourceSampleTypeService;
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 检验委托来源与样品类型配置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qms/config-entrust-source-sample-type")
|
||||||
|
@Validated
|
||||||
|
public class ConfigEntrustSourceSampleTypeController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigEntrustSourceSampleTypeService configEntrustSourceSampleTypeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:create')")
|
||||||
|
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> createConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) {
|
||||||
|
return success(configEntrustSourceSampleTypeService.createConfigEntrustSourceSampleType(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:update')")
|
||||||
|
public CommonResult<Boolean> updateConfigEntrustSourceSampleType(@Valid @RequestBody ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) {
|
||||||
|
configEntrustSourceSampleTypeService.updateConfigEntrustSourceSampleType(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除检验委托来源与样品类型配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||||
|
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleType(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除检验委托来源与样品类型配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteConfigEntrustSourceSampleTypeList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
configEntrustSourceSampleTypeService.deleteConfigEntrustSourceSampleTypeListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得检验委托来源与样品类型配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||||
|
public CommonResult<ConfigEntrustSourceSampleTypeRespVO> getConfigEntrustSourceSampleType(@RequestParam("id") Long id) {
|
||||||
|
ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleType(id);
|
||||||
|
return success(BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得检验委托来源与样品类型配置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:query')")
|
||||||
|
public CommonResult<PageResult<ConfigEntrustSourceSampleTypeRespVO>> getConfigEntrustSourceSampleTypePage(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO) {
|
||||||
|
PageResult<ConfigEntrustSourceSampleTypeDO> pageResult = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出检验委托来源与样品类型配置 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qms:config-entrust-source-sample-type:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportConfigEntrustSourceSampleTypeExcel(@Valid ConfigEntrustSourceSampleTypePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ConfigEntrustSourceSampleTypeDO> list = configEntrustSourceSampleTypeService.getConfigEntrustSourceSampleTypePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "检验委托来源与样品类型配置.xls", "数据", ConfigEntrustSourceSampleTypeRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ConfigEntrustSourceSampleTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,4 +42,9 @@ public class BaseSamplePageReqVO extends PageParam {
|
|||||||
@Schema(description = "检测标准数量")
|
@Schema(description = "检测标准数量")
|
||||||
private String assayStandardCount;
|
private String assayStandardCount;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "委托类型,委托登记-entrust_registration、检验委托-entrust_inspection", example = "1")
|
||||||
|
private String entrustType;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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 ConfigEntrustSourceSampleTypePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", example = "321")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", example = "30057")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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 ConfigEntrustSourceSampleTypeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||||
|
@ExcelProperty("检验委托来源配置ID")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||||
|
@ExcelProperty("样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
@ExcelProperty("参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
@ExcelProperty("所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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 ConfigEntrustSourceSampleTypeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2073")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "检验委托来源配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "321")
|
||||||
|
@NotEmpty(message = "检验委托来源配置ID不能为空")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
|
||||||
|
@Schema(description = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "30057")
|
||||||
|
@NotNull(message = "样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品不能为空")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
|
||||||
|
@Schema(description = "参数分组_Key,字典表【T_DIC_BSN】样品类型")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -52,10 +52,15 @@ public class BaseSampleDO extends BusinessBaseDO {
|
|||||||
@TableField("MTRL_NAME")
|
@TableField("MTRL_NAME")
|
||||||
private String materialName;
|
private String materialName;
|
||||||
/**
|
/**
|
||||||
* 样品类型_ID,字典表【T_DIC_BSN】结算样、委检样、抽查样
|
* 样品类型
|
||||||
*/
|
*/
|
||||||
@TableField("DIC_BSN_ID")
|
@TableField("DIC_BSN_ID")
|
||||||
private Long dictionaryBusinessId;
|
private Long dictionaryBusinessId;
|
||||||
|
/**
|
||||||
|
* 样品类型key
|
||||||
|
*/
|
||||||
|
@TableField("DIC_BSN_KY")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
/**
|
/**
|
||||||
* 所属部门
|
* 所属部门
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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_cfg_entt_src_smp_tp")
|
||||||
|
@KeySequence("t_cfg_entt_src_smp_tp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class ConfigEntrustSourceSampleTypeDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 检验委托来源配置ID
|
||||||
|
*/
|
||||||
|
@TableField("CFG_ENTT_SRC_ID")
|
||||||
|
private Long configEntrustSourceId;
|
||||||
|
/**
|
||||||
|
* 样品类型_ID,字典表【T_DIC_BSN】样品类型:委检样、商检分析样、商检综合样、西南铜产品
|
||||||
|
*/
|
||||||
|
@TableField("DIC_BSN_ID")
|
||||||
|
private Long dictionaryBusinessId;
|
||||||
|
/**
|
||||||
|
* 参数分组_Key,字典表【T_DIC_BSN】样品类型
|
||||||
|
*/
|
||||||
|
@TableField("DIC_BSN_KY")
|
||||||
|
private String dictionaryBusinessKey;
|
||||||
|
/**
|
||||||
|
* 所属部门
|
||||||
|
*/
|
||||||
|
@TableField("SYS_DEPT_CD")
|
||||||
|
private String systemDepartmentCode;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.module.qms.business.config.controller.vo.BaseSamplePageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.BaseSampleDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -29,6 +36,28 @@ public interface BaseSampleMapper extends BaseMapperX<BaseSampleDO> {
|
|||||||
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark())
|
||||||
.orderByDesc(BaseSampleDO::getId));
|
.orderByDesc(BaseSampleDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<BaseSampleRespVO> selectList(BaseSamplePageReqVO reqVO) {
|
||||||
|
LambdaQueryWrapperX<BaseSampleDO> queryWrapperX = new LambdaQueryWrapperX<BaseSampleDO>()
|
||||||
|
.likeIfPresent(BaseSampleDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(BaseSampleDO::getMaterialId, reqVO.getMaterialId())
|
||||||
|
.eqIfPresent(BaseSampleDO::getMaterialCode, reqVO.getMaterialCode())
|
||||||
|
.likeIfPresent(BaseSampleDO::getMaterialName, reqVO.getMaterialName())
|
||||||
|
.eqIfPresent(BaseSampleDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||||
|
.eqIfPresent(BaseSampleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.betweenIfPresent(BaseSampleDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(BaseSampleDO::getRemark, reqVO.getRemark());
|
||||||
|
if (ObjectUtil.isNotEmpty(reqVO.getConfigEntrustSourceId())) {
|
||||||
|
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst WHERE tcesst.CFG_ENTT_SRC_ID = " + reqVO.getConfigEntrustSourceId());
|
||||||
|
}
|
||||||
|
if (QmsCommonConstant.ENTRUST_INSPECTION.equals(reqVO.getEntrustType())) {
|
||||||
|
queryWrapperX.inSql(BaseSampleDO::getDictionaryBusinessId, "SELECT tcesst.DIC_BSN_ID FROM T_CFG_ENTT_SRC_SMP_TP tcesst LEFT JOIN T_CFG_ENTT_SRC tces ON tcesst.CFG_ENTT_SRC_ID = tces.ID WHERE tces.ENTT_TP = '" + reqVO.getEntrustType() + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
queryWrapperX.orderByDesc(BaseSampleDO::getId);
|
||||||
|
List<BaseSampleDO> list = selectList(queryWrapperX);
|
||||||
|
return BeanUtils.toBean(list, BaseSampleRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
List<BaseSampleDO> getBaseSampleListWithAssayStandardCount();
|
List<BaseSampleDO> getBaseSampleListWithAssayStandardCount();
|
||||||
|
|
||||||
|
|||||||
@@ -69,5 +69,6 @@ public interface ConfigAssayMethodMapper extends BaseMapperX<ConfigAssayMethodDO
|
|||||||
.eqIfPresent(ConfigAssayMethodDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(ConfigAssayMethodDO::getVersion, reqVO.getVersion())
|
||||||
.orderByDesc(ConfigAssayMethodDO::getId));
|
.orderByDesc(ConfigAssayMethodDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigBaseSamplePageReqVO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigBaseSampleDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,5 +34,10 @@ public interface ConfigBaseSampleMapper extends BaseMapperX<ConfigBaseSampleDO>
|
|||||||
.eqIfPresent(ConfigBaseSampleDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(ConfigBaseSampleDO::getVersion, reqVO.getVersion())
|
||||||
.orderByDesc(ConfigBaseSampleDO::getId));
|
.orderByDesc(ConfigBaseSampleDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigBaseSampleDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<ConfigBaseSampleDO>()
|
||||||
|
.in(ConfigBaseSampleDO::getBaseSampleId, baseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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.config.controller.vo.ConfigEntrustSourceSampleTypePageReqVO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验委托来源与样品类型配置 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ConfigEntrustSourceSampleTypeMapper extends BaseMapperX<ConfigEntrustSourceSampleTypeDO> {
|
||||||
|
|
||||||
|
default PageResult<ConfigEntrustSourceSampleTypeDO> selectPage(ConfigEntrustSourceSampleTypePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigEntrustSourceSampleTypeDO>()
|
||||||
|
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getConfigEntrustSourceId, reqVO.getConfigEntrustSourceId())
|
||||||
|
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessId, reqVO.getDictionaryBusinessId())
|
||||||
|
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getDictionaryBusinessKey, reqVO.getDictionaryBusinessKey())
|
||||||
|
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
|
.betweenIfPresent(ConfigEntrustSourceSampleTypeDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(ConfigEntrustSourceSampleTypeDO::getRemark, reqVO.getRemark())
|
||||||
|
.orderByDesc(ConfigEntrustSourceSampleTypeDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -51,4 +51,9 @@ public interface ConfigSampleReportMapper extends BaseMapperX<ConfigSampleReport
|
|||||||
.eqIfPresent(ConfigSampleReportDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(ConfigSampleReportDO::getVersion, reqVO.getVersion())
|
||||||
.orderByDesc(ConfigSampleReportDO::getId));
|
.orderByDesc(ConfigSampleReportDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigSampleReportDO> selectByConfigBaseSampleIds(List<Long> configBaseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<ConfigSampleReportDO>()
|
||||||
|
.in(ConfigSampleReportDO::getConfigBaseSampleId, configBaseSampleIds));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSamplePageReqVO;
|
||||||
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.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -39,5 +42,10 @@ public interface ConfigSubSampleMapper extends BaseMapperX<ConfigSubSampleDO> {
|
|||||||
.eqIfPresent(ConfigSubSampleDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(ConfigSubSampleDO::getVersion, reqVO.getVersion())
|
||||||
.orderByDesc(ConfigSubSampleDO::getId));
|
.orderByDesc(ConfigSubSampleDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigSubSampleDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<ConfigSubSampleDO>()
|
||||||
|
.in(ConfigSubSampleDO::getBaseSampleId, baseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -59,5 +59,10 @@ public interface ConfigSubSampleMethodMapper extends BaseMapperX<ConfigSubSample
|
|||||||
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds)
|
||||||
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
.eq(ConfigSubSampleMethodDO::getConfigAssayMethodId, configAssayMethodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigSubSampleMethodDO> selectByConfigSubSampleIds(List<Long> configSubSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapper<ConfigSubSampleMethodDO>()
|
||||||
|
.in(ConfigSubSampleMethodDO::getConfigSubSampleId, configSubSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,9 @@ import com.zt.plat.module.qms.business.config.controller.vo.*;
|
|||||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO;
|
import com.zt.plat.module.qms.business.config.controller.vo.ConfigSubSampleParentPageReqVO;
|
||||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO;
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentDO;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,5 +33,10 @@ public interface ConfigSubSampleParentMapper extends BaseMapperX<ConfigSubSample
|
|||||||
.eqIfPresent(ConfigSubSampleParentDO::getVersion, reqVO.getVersion())
|
.eqIfPresent(ConfigSubSampleParentDO::getVersion, reqVO.getVersion())
|
||||||
.orderByDesc(ConfigSubSampleParentDO::getId));
|
.orderByDesc(ConfigSubSampleParentDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default List<ConfigSubSampleParentDO> selectByBaseSampleIds(List<Long> baseSampleIds) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<ConfigSubSampleParentDO>()
|
||||||
|
.in(ConfigSubSampleParentDO::getBaseSampleId, baseSampleIds));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -63,4 +63,11 @@ public interface BaseSampleService {
|
|||||||
*/
|
*/
|
||||||
PageResult<BaseSampleDO> getBaseSamplePage(BaseSamplePageReqVO pageReqVO);
|
PageResult<BaseSampleDO> getBaseSamplePage(BaseSamplePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得样品大类管理列表
|
||||||
|
* @param reqVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<BaseSampleRespVO> getBaseSampleList(BaseSamplePageReqVO reqVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -92,4 +92,9 @@ public class BaseSampleServiceImpl implements BaseSampleService {
|
|||||||
return baseSampleMapper.selectPage(pageReqVO);
|
return baseSampleMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BaseSampleRespVO> getBaseSampleList(BaseSamplePageReqVO reqVO) {
|
||||||
|
return baseSampleMapper.selectList(reqVO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.service;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验委托来源与样品类型配置 Service 接口
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
public interface ConfigEntrustSourceSampleTypeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建检验委托来源与样品类型配置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新检验委托来源与样品类型配置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateConfigEntrustSourceSampleType(@Valid ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除检验委托来源与样品类型配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteConfigEntrustSourceSampleType(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除检验委托来源与样品类型配置
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteConfigEntrustSourceSampleTypeListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得检验委托来源与样品类型配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 检验委托来源与样品类型配置
|
||||||
|
*/
|
||||||
|
ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得检验委托来源与样品类型配置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 检验委托来源与样品类型配置分页
|
||||||
|
*/
|
||||||
|
PageResult<ConfigEntrustSourceSampleTypeDO> getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package com.zt.plat.module.qms.business.config.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.config.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceSampleTypeDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigEntrustSourceSampleTypeMapper;
|
||||||
|
|
||||||
|
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 ConfigEntrustSourceSampleTypeServiceImpl implements ConfigEntrustSourceSampleTypeService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigEntrustSourceSampleTypeMapper configEntrustSourceSampleTypeMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfigEntrustSourceSampleTypeRespVO createConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ConfigEntrustSourceSampleTypeDO configEntrustSourceSampleType = BeanUtils.toBean(createReqVO, ConfigEntrustSourceSampleTypeDO.class);
|
||||||
|
configEntrustSourceSampleTypeMapper.insert(configEntrustSourceSampleType);
|
||||||
|
// 返回
|
||||||
|
return BeanUtils.toBean(configEntrustSourceSampleType, ConfigEntrustSourceSampleTypeRespVO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateConfigEntrustSourceSampleType(ConfigEntrustSourceSampleTypeSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateConfigEntrustSourceSampleTypeExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ConfigEntrustSourceSampleTypeDO updateObj = BeanUtils.toBean(updateReqVO, ConfigEntrustSourceSampleTypeDO.class);
|
||||||
|
configEntrustSourceSampleTypeMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteConfigEntrustSourceSampleType(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateConfigEntrustSourceSampleTypeExists(id);
|
||||||
|
// 删除
|
||||||
|
configEntrustSourceSampleTypeMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteConfigEntrustSourceSampleTypeListByIds(List<Long> ids) {
|
||||||
|
// 校验存在
|
||||||
|
validateConfigEntrustSourceSampleTypeExists(ids);
|
||||||
|
// 删除
|
||||||
|
configEntrustSourceSampleTypeMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateConfigEntrustSourceSampleTypeExists(List<Long> ids) {
|
||||||
|
List<ConfigEntrustSourceSampleTypeDO> list = configEntrustSourceSampleTypeMapper.selectByIds(ids);
|
||||||
|
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||||
|
throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateConfigEntrustSourceSampleTypeExists(Long id) {
|
||||||
|
if (configEntrustSourceSampleTypeMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONFIG_ENTRUST_SOURCE_SAMPLE_TYPE_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfigEntrustSourceSampleTypeDO getConfigEntrustSourceSampleType(Long id) {
|
||||||
|
return configEntrustSourceSampleTypeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ConfigEntrustSourceSampleTypeDO> getConfigEntrustSourceSampleTypePage(ConfigEntrustSourceSampleTypePageReqVO pageReqVO) {
|
||||||
|
return configEntrustSourceSampleTypeMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
|
||||||
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 com.zt.plat.framework.business.annotation.FileUploadController;
|
|
||||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
|
||||||
|
|
||||||
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.*;
|
|
||||||
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.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleService;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 物料通用流程")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/qms/material-lifecycle")
|
|
||||||
@Validated
|
|
||||||
@FileUploadController(source = "qms.materiallifecycle")
|
|
||||||
public class MaterialLifecycleController extends AbstractFileUploadController implements BusinessControllerMarker{
|
|
||||||
|
|
||||||
static {
|
|
||||||
FileUploadController annotation = MaterialLifecycleController.class.getAnnotation(FileUploadController.class);
|
|
||||||
if (annotation != null) {
|
|
||||||
setFileUploadInfo(annotation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MaterialLifecycleService materialLifecycleService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建物料通用流程")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:create')")
|
|
||||||
public CommonResult<MaterialLifecycleRespVO> createMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO createReqVO) {
|
|
||||||
return success(materialLifecycleService.createMaterialLifecycle(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新物料通用流程")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:update')")
|
|
||||||
public CommonResult<Boolean> updateMaterialLifecycle(@Valid @RequestBody MaterialLifecycleSaveReqVO updateReqVO) {
|
|
||||||
materialLifecycleService.updateMaterialLifecycle(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除物料通用流程")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMaterialLifecycle(@RequestParam("id") Long id) {
|
|
||||||
materialLifecycleService.deleteMaterialLifecycle(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-list")
|
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
|
||||||
@Operation(summary = "批量删除物料通用流程")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMaterialLifecycleList(@RequestBody BatchDeleteReqVO req) {
|
|
||||||
materialLifecycleService.deleteMaterialLifecycleListByIds(req.getIds());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得物料通用流程")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
|
||||||
public CommonResult<MaterialLifecycleRespVO> getMaterialLifecycle(@RequestParam("id") Long id) {
|
|
||||||
MaterialLifecycleDO materialLifecycle = materialLifecycleService.getMaterialLifecycle(id);
|
|
||||||
return success(BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得物料通用流程分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:query')")
|
|
||||||
public CommonResult<PageResult<MaterialLifecycleRespVO>> getMaterialLifecyclePage(@Valid MaterialLifecyclePageReqVO pageReqVO) {
|
|
||||||
PageResult<MaterialLifecycleDO> pageResult = materialLifecycleService.getMaterialLifecyclePage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, MaterialLifecycleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出物料通用流程 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportMaterialLifecycleExcel(@Valid MaterialLifecyclePageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<MaterialLifecycleDO> list = materialLifecycleService.getMaterialLifecyclePage(pageReqVO).getList();
|
|
||||||
// 导出 Excel
|
|
||||||
ExcelUtils.write(response, "物料通用流程.xls", "数据", MaterialLifecycleRespVO.class,
|
|
||||||
BeanUtils.toBean(list, MaterialLifecycleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.admin;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
|
||||||
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 com.zt.plat.framework.business.annotation.FileUploadController;
|
|
||||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
|
||||||
|
|
||||||
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.*;
|
|
||||||
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.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.service.MaterialLifecycleDetailService;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 物料通用流程明细,对应生命周期的明细")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/qms/material-lifecycle-detail")
|
|
||||||
@Validated
|
|
||||||
@FileUploadController(source = "qms.materiallifecycledetail")
|
|
||||||
public class MaterialLifecycleDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
|
||||||
|
|
||||||
static {
|
|
||||||
FileUploadController annotation = MaterialLifecycleDetailController.class.getAnnotation(FileUploadController.class);
|
|
||||||
if (annotation != null) {
|
|
||||||
setFileUploadInfo(annotation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MaterialLifecycleDetailService materialLifecycleDetailService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建物料通用流程明细,对应生命周期的明细")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:create')")
|
|
||||||
public CommonResult<MaterialLifecycleDetailRespVO> createMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO createReqVO) {
|
|
||||||
return success(materialLifecycleDetailService.createMaterialLifecycleDetail(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新物料通用流程明细,对应生命周期的明细")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:update')")
|
|
||||||
public CommonResult<Boolean> updateMaterialLifecycleDetail(@Valid @RequestBody MaterialLifecycleDetailSaveReqVO updateReqVO) {
|
|
||||||
materialLifecycleDetailService.updateMaterialLifecycleDetail(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除物料通用流程明细,对应生命周期的明细")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
|
||||||
materialLifecycleDetailService.deleteMaterialLifecycleDetail(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete-list")
|
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
|
||||||
@Operation(summary = "批量删除物料通用流程明细,对应生命周期的明细")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMaterialLifecycleDetailList(@RequestBody BatchDeleteReqVO req) {
|
|
||||||
materialLifecycleDetailService.deleteMaterialLifecycleDetailListByIds(req.getIds());
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
|
||||||
public CommonResult<MaterialLifecycleDetailRespVO> getMaterialLifecycleDetail(@RequestParam("id") Long id) {
|
|
||||||
MaterialLifecycleDetailDO materialLifecycleDetail = materialLifecycleDetailService.getMaterialLifecycleDetail(id);
|
|
||||||
return success(BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得物料通用流程明细,对应生命周期的明细分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:query')")
|
|
||||||
public CommonResult<PageResult<MaterialLifecycleDetailRespVO>> getMaterialLifecycleDetailPage(@Valid MaterialLifecycleDetailPageReqVO pageReqVO) {
|
|
||||||
PageResult<MaterialLifecycleDetailDO> pageResult = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, MaterialLifecycleDetailRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出物料通用流程明细,对应生命周期的明细 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('qms:material-lifecycle-detail:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportMaterialLifecycleDetailExcel(@Valid MaterialLifecycleDetailPageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailService.getMaterialLifecycleDetailPage(pageReqVO).getList();
|
|
||||||
// 导出 Excel
|
|
||||||
ExcelUtils.write(response, "物料通用流程明细,对应生命周期的明细.xls", "数据", MaterialLifecycleDetailRespVO.class,
|
|
||||||
BeanUtils.toBean(list, MaterialLifecycleDetailRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
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 MaterialLifecycleDetailPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "父ID", example = "24095")
|
|
||||||
private Long materialLifecycleId;
|
|
||||||
|
|
||||||
@Schema(description = "物料批次编号", example = "30393")
|
|
||||||
private Long batchId;
|
|
||||||
|
|
||||||
@Schema(description = "物料大类编号", example = "1020")
|
|
||||||
private String categoryProductId;
|
|
||||||
|
|
||||||
@Schema(description = "物料实例编号", example = "11872")
|
|
||||||
private Long infomationId;
|
|
||||||
|
|
||||||
@Schema(description = "影响数量", example = "28166")
|
|
||||||
private String influenceCount;
|
|
||||||
|
|
||||||
@Schema(description = "明细操作类型", example = "2")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "处理状态", example = "1")
|
|
||||||
private Integer treatmentStatus;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", example = "赵六")
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.alibaba.excel.annotation.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料通用流程明细,对应生命周期的明细 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class MaterialLifecycleDetailRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30686")
|
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "父ID", example = "24095")
|
|
||||||
@ExcelProperty("父ID")
|
|
||||||
private Long materialLifecycleId;
|
|
||||||
|
|
||||||
@Schema(description = "物料批次编号", example = "30393")
|
|
||||||
@ExcelProperty("物料批次编号")
|
|
||||||
private Long batchId;
|
|
||||||
|
|
||||||
@Schema(description = "物料大类编号", example = "1020")
|
|
||||||
@ExcelProperty("物料大类编号")
|
|
||||||
private String categoryProductId;
|
|
||||||
|
|
||||||
@Schema(description = "物料实例编号", example = "11872")
|
|
||||||
@ExcelProperty("物料实例编号")
|
|
||||||
private Long infomationId;
|
|
||||||
|
|
||||||
@Schema(description = "影响数量", example = "28166")
|
|
||||||
@ExcelProperty("影响数量")
|
|
||||||
private String influenceCount;
|
|
||||||
|
|
||||||
@Schema(description = "明细操作类型", example = "2")
|
|
||||||
@ExcelProperty("明细操作类型")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "处理状态", example = "1")
|
|
||||||
@ExcelProperty("处理状态")
|
|
||||||
private Integer treatmentStatus;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
@ExcelProperty("表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
@ExcelProperty("所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "公司编号", example = "2613")
|
|
||||||
@ExcelProperty("公司编号")
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", example = "赵六")
|
|
||||||
@ExcelProperty("公司名称")
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
@Schema(description = "部门编号", example = "32413")
|
|
||||||
@ExcelProperty("部门编号")
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
@ExcelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料通用流程明细,对应生命周期的明细新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class MaterialLifecycleDetailSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30686")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "父ID", example = "24095")
|
|
||||||
private Long materialLifecycleId;
|
|
||||||
|
|
||||||
@Schema(description = "物料批次编号", example = "30393")
|
|
||||||
private Long batchId;
|
|
||||||
|
|
||||||
@Schema(description = "物料大类编号", example = "1020")
|
|
||||||
private String categoryProductId;
|
|
||||||
|
|
||||||
@Schema(description = "物料实例编号", example = "11872")
|
|
||||||
private Long infomationId;
|
|
||||||
|
|
||||||
@Schema(description = "影响数量", example = "28166")
|
|
||||||
private String influenceCount;
|
|
||||||
|
|
||||||
@Schema(description = "明细操作类型", example = "2")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "处理状态", example = "1")
|
|
||||||
private Integer treatmentStatus;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "公司编号", example = "2613")
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
@Schema(description = "公司名称", example = "赵六")
|
|
||||||
private String companyName;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
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 MaterialLifecyclePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "标题")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型编码")
|
|
||||||
private String businessTypeCode;
|
|
||||||
|
|
||||||
@Schema(description = "申请人")
|
|
||||||
private String applyUser;
|
|
||||||
|
|
||||||
@Schema(description = "申请人id", example = "29846")
|
|
||||||
private Long applyUserId;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门")
|
|
||||||
private String applyDepartment;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门id", example = "7174")
|
|
||||||
private Long applyDepartmentId;
|
|
||||||
|
|
||||||
@Schema(description = "申请时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] applyTime;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "流程实例id", example = "28688")
|
|
||||||
private String flowInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "流程审批状态", example = "2")
|
|
||||||
private String flowStatus;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.alibaba.excel.annotation.*;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料通用流程 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class MaterialLifecycleRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4561")
|
|
||||||
@ExcelProperty("主键")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "标题")
|
|
||||||
@ExcelProperty("标题")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
|
||||||
@ExcelProperty("业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型编码")
|
|
||||||
@ExcelProperty("业务类型编码")
|
|
||||||
private String businessTypeCode;
|
|
||||||
|
|
||||||
@Schema(description = "申请人")
|
|
||||||
@ExcelProperty("申请人")
|
|
||||||
private String applyUser;
|
|
||||||
|
|
||||||
@Schema(description = "申请人id", example = "29846")
|
|
||||||
@ExcelProperty("申请人id")
|
|
||||||
private Long applyUserId;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门")
|
|
||||||
@ExcelProperty("申请部门")
|
|
||||||
private String applyDepartment;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门id", example = "7174")
|
|
||||||
@ExcelProperty("申请部门id")
|
|
||||||
private Long applyDepartmentId;
|
|
||||||
|
|
||||||
@Schema(description = "申请时间")
|
|
||||||
@ExcelProperty("申请时间")
|
|
||||||
private LocalDateTime applyTime;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
@ExcelProperty("表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "流程实例id", example = "28688")
|
|
||||||
@ExcelProperty("流程实例id")
|
|
||||||
private String flowInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "流程审批状态", example = "2")
|
|
||||||
@ExcelProperty("流程审批状态")
|
|
||||||
private String flowStatus;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
@ExcelProperty("所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
@ExcelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.controller.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 物料通用流程新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class MaterialLifecycleSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4561")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "标题")
|
|
||||||
private String title;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请", example = "2")
|
|
||||||
private String businessType;
|
|
||||||
|
|
||||||
@Schema(description = "业务类型编码")
|
|
||||||
private String businessTypeCode;
|
|
||||||
|
|
||||||
@Schema(description = "申请人")
|
|
||||||
private String applyUser;
|
|
||||||
|
|
||||||
@Schema(description = "申请人id", example = "29846")
|
|
||||||
private Long applyUserId;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门")
|
|
||||||
private String applyDepartment;
|
|
||||||
|
|
||||||
@Schema(description = "申请部门id", example = "7174")
|
|
||||||
private Long applyDepartmentId;
|
|
||||||
|
|
||||||
@Schema(description = "申请时间")
|
|
||||||
private LocalDateTime applyTime;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据,表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "流程实例id", example = "28688")
|
|
||||||
private String flowInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "流程审批状态", example = "2")
|
|
||||||
private String flowStatus;
|
|
||||||
|
|
||||||
@Schema(description = "所属部门")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
|
||||||
/**
|
|
||||||
* 物料通用流程 DO
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@TableName("t_mtrl_lfc")
|
|
||||||
@KeySequence("t_mtrl_lfc_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
/**
|
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
|
||||||
*/
|
|
||||||
public class MaterialLifecycleDO extends BusinessBaseDO {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
@TableField("TTL")
|
|
||||||
private String title;
|
|
||||||
/**
|
|
||||||
* 业务类型,【字典】【jy_material_lifecycle_bsn_type】验收、退换货、配置申请
|
|
||||||
*/
|
|
||||||
@TableField("BSN_TP")
|
|
||||||
private String businessType;
|
|
||||||
/**
|
|
||||||
* 业务类型编码
|
|
||||||
*/
|
|
||||||
@TableField("BSN_TP_CD")
|
|
||||||
private String businessTypeCode;
|
|
||||||
/**
|
|
||||||
* 申请人
|
|
||||||
*/
|
|
||||||
@TableField("APL_USER")
|
|
||||||
private String applyUser;
|
|
||||||
/**
|
|
||||||
* 申请人id
|
|
||||||
*/
|
|
||||||
@TableField("APL_USER_ID")
|
|
||||||
private Long applyUserId;
|
|
||||||
/**
|
|
||||||
* 申请部门
|
|
||||||
*/
|
|
||||||
@TableField("APL_DEPT")
|
|
||||||
private String applyDepartment;
|
|
||||||
/**
|
|
||||||
* 申请部门id
|
|
||||||
*/
|
|
||||||
@TableField("APL_DEPT_ID")
|
|
||||||
private Long applyDepartmentId;
|
|
||||||
/**
|
|
||||||
* 申请时间
|
|
||||||
*/
|
|
||||||
@TableField("APL_TM")
|
|
||||||
private LocalDateTime applyTime;
|
|
||||||
/**
|
|
||||||
* 表单数据,表单数据
|
|
||||||
*/
|
|
||||||
@TableField("FORM_DAT")
|
|
||||||
private String formData;
|
|
||||||
/**
|
|
||||||
* 流程实例id
|
|
||||||
*/
|
|
||||||
@TableField("FLW_INSC_ID")
|
|
||||||
private String flowInstanceId;
|
|
||||||
/**
|
|
||||||
* 流程审批状态
|
|
||||||
*/
|
|
||||||
@TableField("FLW_STS")
|
|
||||||
private String flowStatus;
|
|
||||||
/**
|
|
||||||
* 所属部门
|
|
||||||
*/
|
|
||||||
@TableField("SYS_DEPT_CD")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField("RMK")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.dal.dataobject;
|
|
||||||
|
|
||||||
import lombok.*;
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
|
||||||
/**
|
|
||||||
* 物料通用流程明细,对应生命周期的明细 DO
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@TableName("t_mtrl_lfc_dtl")
|
|
||||||
@KeySequence("t_mtrl_lfc_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
/**
|
|
||||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
|
||||||
*/
|
|
||||||
public class MaterialLifecycleDetailDO extends BusinessBaseDO {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 父ID
|
|
||||||
*/
|
|
||||||
@TableField("MTRL_LFC_ID")
|
|
||||||
private Long materialLifecycleId;
|
|
||||||
/**
|
|
||||||
* 物料批次编号
|
|
||||||
*/
|
|
||||||
@TableField("BAT_ID")
|
|
||||||
private Long batchId;
|
|
||||||
/**
|
|
||||||
* 物料大类编号
|
|
||||||
*/
|
|
||||||
@TableField("CTGR_PDT_ID")
|
|
||||||
private String categoryProductId;
|
|
||||||
/**
|
|
||||||
* 物料实例编号
|
|
||||||
*/
|
|
||||||
@TableField("INF_ID")
|
|
||||||
private Long infomationId;
|
|
||||||
/**
|
|
||||||
* 影响数量
|
|
||||||
*/
|
|
||||||
@TableField("INFL_CNT")
|
|
||||||
private String influenceCount;
|
|
||||||
/**
|
|
||||||
* 明细操作类型
|
|
||||||
*/
|
|
||||||
@TableField("BSN_TP")
|
|
||||||
private String businessType;
|
|
||||||
/**
|
|
||||||
* 处理状态
|
|
||||||
*/
|
|
||||||
@TableField("TMT_STS")
|
|
||||||
private Integer treatmentStatus;
|
|
||||||
/**
|
|
||||||
* 表单数据,表单数据
|
|
||||||
*/
|
|
||||||
@TableField("FORM_DAT")
|
|
||||||
private String formData;
|
|
||||||
/**
|
|
||||||
* 所属部门
|
|
||||||
*/
|
|
||||||
@TableField("SYS_DEPT_CD")
|
|
||||||
private String systemDepartmentCode;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
@TableField("RMK")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程明细,对应生命周期的明细 Mapper
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface MaterialLifecycleDetailMapper extends BaseMapperX<MaterialLifecycleDetailDO> {
|
|
||||||
|
|
||||||
default PageResult<MaterialLifecycleDetailDO> selectPage(MaterialLifecycleDetailPageReqVO reqVO) {
|
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDetailDO>()
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getMaterialLifecycleId, reqVO.getMaterialLifecycleId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getBatchId, reqVO.getBatchId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getCategoryProductId, reqVO.getCategoryProductId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getInfomationId, reqVO.getInfomationId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getInfluenceCount, reqVO.getInfluenceCount())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getBusinessType, reqVO.getBusinessType())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getTreatmentStatus, reqVO.getTreatmentStatus())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getFormData, reqVO.getFormData())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
|
||||||
.likeIfPresent(MaterialLifecycleDetailDO::getCompanyName, reqVO.getCompanyName())
|
|
||||||
.eqIfPresent(MaterialLifecycleDetailDO::getRemark, reqVO.getRemark())
|
|
||||||
.betweenIfPresent(MaterialLifecycleDetailDO::getCreateTime, reqVO.getCreateTime())
|
|
||||||
.orderByDesc(MaterialLifecycleDetailDO::getId));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.dal.mapper;
|
|
||||||
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程 Mapper
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface MaterialLifecycleMapper extends BaseMapperX<MaterialLifecycleDO> {
|
|
||||||
|
|
||||||
default PageResult<MaterialLifecycleDO> selectPage(MaterialLifecyclePageReqVO reqVO) {
|
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialLifecycleDO>()
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getTitle, reqVO.getTitle())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getBusinessType, reqVO.getBusinessType())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getBusinessTypeCode, reqVO.getBusinessTypeCode())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getApplyUser, reqVO.getApplyUser())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getApplyUserId, reqVO.getApplyUserId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getApplyDepartment, reqVO.getApplyDepartment())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getApplyDepartmentId, reqVO.getApplyDepartmentId())
|
|
||||||
.betweenIfPresent(MaterialLifecycleDO::getApplyTime, reqVO.getApplyTime())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getFormData, reqVO.getFormData())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getFlowStatus, reqVO.getFlowStatus())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
|
||||||
.eqIfPresent(MaterialLifecycleDO::getRemark, reqVO.getRemark())
|
|
||||||
.betweenIfPresent(MaterialLifecycleDO::getCreateTime, reqVO.getCreateTime())
|
|
||||||
.orderByDesc(MaterialLifecycleDO::getId));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.service;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
|
||||||
import jakarta.validation.*;
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程明细,对应生命周期的明细 Service 接口
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
public interface MaterialLifecycleDetailService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建物料通用流程明细,对应生命周期的明细
|
|
||||||
*
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新物料通用流程明细,对应生命周期的明细
|
|
||||||
*
|
|
||||||
* @param updateReqVO 更新信息
|
|
||||||
*/
|
|
||||||
void updateMaterialLifecycleDetail(@Valid MaterialLifecycleDetailSaveReqVO updateReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除物料通用流程明细,对应生命周期的明细
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteMaterialLifecycleDetail(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除物料通用流程明细,对应生命周期的明细
|
|
||||||
*
|
|
||||||
* @param ids 编号
|
|
||||||
*/
|
|
||||||
void deleteMaterialLifecycleDetailListByIds(List<Long> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得物料通用流程明细,对应生命周期的明细
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
* @return 物料通用流程明细,对应生命周期的明细
|
|
||||||
*/
|
|
||||||
MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得物料通用流程明细,对应生命周期的明细分页
|
|
||||||
*
|
|
||||||
* @param pageReqVO 分页查询
|
|
||||||
* @return 物料通用流程明细,对应生命周期的明细分页
|
|
||||||
*/
|
|
||||||
PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailPageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleDetailSaveReqVO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDetailDO;
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleDetailMapper;
|
|
||||||
|
|
||||||
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.module.qms.enums.ErrorCodeConstants.MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程明细,对应生命周期的明细 Service 实现类
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Validated
|
|
||||||
public class MaterialLifecycleDetailServiceImpl implements MaterialLifecycleDetailService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MaterialLifecycleDetailMapper materialLifecycleDetailMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MaterialLifecycleDetailRespVO createMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO createReqVO) {
|
|
||||||
// 插入
|
|
||||||
MaterialLifecycleDetailDO materialLifecycleDetail = BeanUtils.toBean(createReqVO, MaterialLifecycleDetailDO.class);
|
|
||||||
materialLifecycleDetailMapper.insert(materialLifecycleDetail);
|
|
||||||
// 返回
|
|
||||||
return BeanUtils.toBean(materialLifecycleDetail, MaterialLifecycleDetailRespVO.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateMaterialLifecycleDetail(MaterialLifecycleDetailSaveReqVO updateReqVO) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleDetailExists(updateReqVO.getId());
|
|
||||||
// 更新
|
|
||||||
MaterialLifecycleDetailDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDetailDO.class);
|
|
||||||
materialLifecycleDetailMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteMaterialLifecycleDetail(Long id) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleDetailExists(id);
|
|
||||||
// 删除
|
|
||||||
materialLifecycleDetailMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteMaterialLifecycleDetailListByIds(List<Long> ids) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleDetailExists(ids);
|
|
||||||
// 删除
|
|
||||||
materialLifecycleDetailMapper.deleteByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateMaterialLifecycleDetailExists(List<Long> ids) {
|
|
||||||
List<MaterialLifecycleDetailDO> list = materialLifecycleDetailMapper.selectByIds(ids);
|
|
||||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
|
||||||
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateMaterialLifecycleDetailExists(Long id) {
|
|
||||||
if (materialLifecycleDetailMapper.selectById(id) == null) {
|
|
||||||
throw exception(MATERIAL_LIFECYCLE_DETAIL_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MaterialLifecycleDetailDO getMaterialLifecycleDetail(Long id) {
|
|
||||||
return materialLifecycleDetailMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<MaterialLifecycleDetailDO> getMaterialLifecycleDetailPage(MaterialLifecycleDetailPageReqVO pageReqVO) {
|
|
||||||
return materialLifecycleDetailMapper.selectPage(pageReqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.service;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
|
||||||
import jakarta.validation.*;
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程 Service 接口
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
public interface MaterialLifecycleService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建物料通用流程
|
|
||||||
*
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
MaterialLifecycleRespVO createMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新物料通用流程
|
|
||||||
*
|
|
||||||
* @param updateReqVO 更新信息
|
|
||||||
*/
|
|
||||||
void updateMaterialLifecycle(@Valid MaterialLifecycleSaveReqVO updateReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除物料通用流程
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteMaterialLifecycle(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除物料通用流程
|
|
||||||
*
|
|
||||||
* @param ids 编号
|
|
||||||
*/
|
|
||||||
void deleteMaterialLifecycleListByIds(List<Long> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得物料通用流程
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
* @return 物料通用流程
|
|
||||||
*/
|
|
||||||
MaterialLifecycleDO getMaterialLifecycle(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得物料通用流程分页
|
|
||||||
*
|
|
||||||
* @param pageReqVO 分页查询
|
|
||||||
* @return 物料通用流程分页
|
|
||||||
*/
|
|
||||||
PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
package com.zt.plat.module.qms.resource.material.service;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecyclePageReqVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleRespVO;
|
|
||||||
import com.zt.plat.module.qms.resource.material.controller.vo.MaterialLifecycleSaveReqVO;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.dataobject.MaterialLifecycleDO;
|
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleMapper;
|
|
||||||
|
|
||||||
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.module.qms.enums.ErrorCodeConstants.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料通用流程 Service 实现类
|
|
||||||
*
|
|
||||||
* @author 后台管理
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Validated
|
|
||||||
public class MaterialLifecycleServiceImpl implements MaterialLifecycleService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MaterialLifecycleMapper materialLifecycleMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MaterialLifecycleRespVO createMaterialLifecycle(MaterialLifecycleSaveReqVO createReqVO) {
|
|
||||||
// 插入
|
|
||||||
MaterialLifecycleDO materialLifecycle = BeanUtils.toBean(createReqVO, MaterialLifecycleDO.class);
|
|
||||||
materialLifecycleMapper.insert(materialLifecycle);
|
|
||||||
// 返回
|
|
||||||
return BeanUtils.toBean(materialLifecycle, MaterialLifecycleRespVO.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateMaterialLifecycle(MaterialLifecycleSaveReqVO updateReqVO) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleExists(updateReqVO.getId());
|
|
||||||
// 更新
|
|
||||||
MaterialLifecycleDO updateObj = BeanUtils.toBean(updateReqVO, MaterialLifecycleDO.class);
|
|
||||||
materialLifecycleMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteMaterialLifecycle(Long id) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleExists(id);
|
|
||||||
// 删除
|
|
||||||
materialLifecycleMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteMaterialLifecycleListByIds(List<Long> ids) {
|
|
||||||
// 校验存在
|
|
||||||
validateMaterialLifecycleExists(ids);
|
|
||||||
// 删除
|
|
||||||
materialLifecycleMapper.deleteByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateMaterialLifecycleExists(List<Long> ids) {
|
|
||||||
List<MaterialLifecycleDO> list = materialLifecycleMapper.selectByIds(ids);
|
|
||||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
|
||||||
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateMaterialLifecycleExists(Long id) {
|
|
||||||
if (materialLifecycleMapper.selectById(id) == null) {
|
|
||||||
throw exception(MATERIAL_LIFECYCLE_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MaterialLifecycleDO getMaterialLifecycle(Long id) {
|
|
||||||
return materialLifecycleMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<MaterialLifecycleDO> getMaterialLifecyclePage(MaterialLifecyclePageReqVO pageReqVO) {
|
|
||||||
return materialLifecycleMapper.selectPage(pageReqVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?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.resource.material.dal.mapper.MaterialLifecycleDetailMapper">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
|
||||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
|
||||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
|
||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
|
||||||
-->
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
<?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.resource.material.dal.mapper.MaterialLifecycleMapper">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
|
||||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
|
||||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
|
||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
|
||||||
-->
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
Reference in New Issue
Block a user