Compare commits
14 Commits
7f1c4dd8c4
...
lims_dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
927731c217 | ||
| 2b60bd7c7b | |||
|
|
9a2b45e29c | ||
| 7c7e7b4761 | |||
|
|
39d720c1df | ||
|
|
d6fc03b199 | ||
|
|
04ac449897 | ||
|
|
eff36758c2 | ||
|
|
cb50244685 | ||
|
|
246e6391b8 | ||
| 4c129dee4e | |||
| 63fc44a7d1 | |||
| 9a4e50b081 | |||
|
|
8aa329d989 |
12
pom.xml
12
pom.xml
@@ -177,8 +177,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>dev</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
@@ -190,8 +190,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>prod</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
@@ -203,8 +203,8 @@
|
||||
<config.server-addr>172.16.46.63:30848</config.server-addr>
|
||||
<config.namespace>local</config.namespace>
|
||||
<config.group>DEFAULT_GROUP</config.group>
|
||||
<config.username/>
|
||||
<config.password/>
|
||||
<config.username>nacos</config.username>
|
||||
<config.password>P@ssword25</config.password>
|
||||
<config.version>1.0.0</config.version>
|
||||
</properties>
|
||||
</profile>
|
||||
|
||||
@@ -87,7 +87,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CONFIG_PERMISSION_NOT_EXISTS = new ErrorCode(1_032_050_000, "权限配置不存在");
|
||||
ErrorCode CONFIG_PERMISSION_DUPLICATE = new ErrorCode(1_032_050_000, "权限配置数据有误");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS = new ErrorCode(1_032_050_000, "存放位置不存在");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查库位数据,或联系管理员处理!");
|
||||
ErrorCode CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE = new ErrorCode(1_032_050_000, "库位编码重复,请检查!");
|
||||
|
||||
/*=================================bus 检验业务 1_032_100_000 ~ 1_032_149_999==================================*/
|
||||
ErrorCode BUSINESS_SAMPLE_ENTRUST_REGISTRATION_NOT_EXISTS = new ErrorCode(1_032_100_000, "委检登记业务不存在");
|
||||
@@ -149,6 +149,9 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode MATERIAL_INFOMATION_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 ==================================*/
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisAuditService;
|
||||
@@ -25,7 +26,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/analysis-audit")
|
||||
@Validated
|
||||
public class SampleAnalysisAuditController {
|
||||
public class SampleAnalysisAuditController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private SampleAnalysisAuditService sampleAnalysisAuditService;
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleAnalysisService;
|
||||
@@ -23,7 +24,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/analysis")
|
||||
@Validated
|
||||
public class SampleAnalysisController {
|
||||
public class SampleAnalysisController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private SampleAnalysisService sampleAnalysisService ;
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
@@ -34,7 +34,7 @@ import jakarta.validation.Valid;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/entrust")
|
||||
@Validated
|
||||
public class SampleEntrustController {
|
||||
public class SampleEntrustController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private FlowExecutor flowExecutor;
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
@@ -33,7 +33,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.error;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/flow")
|
||||
@Validated
|
||||
public class SampleFlowController {
|
||||
public class SampleFlowController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private SampleFlowService sampleFlowService;
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.service.SampleResultReportingService;
|
||||
@@ -28,7 +29,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/result-reporting")
|
||||
@Validated
|
||||
public class SampleResultReportingController {
|
||||
public class SampleResultReportingController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private SampleResultReportingService sampleResultReportingService;
|
||||
|
||||
@@ -11,6 +11,7 @@ import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
@@ -27,7 +28,7 @@ import jakarta.annotation.Resource;
|
||||
@RestController
|
||||
@RequestMapping("/qms/bus/sample/task-assign")
|
||||
@Validated
|
||||
public class SampleTaskAssignController {
|
||||
public class SampleTaskAssignController implements BusinessControllerMarker {
|
||||
|
||||
@Resource
|
||||
private SampleTaskAssignService sampleTaskAssignService;
|
||||
|
||||
@@ -98,4 +98,8 @@ public class BusinessAssayTaskDataPageReqVO extends PageParam {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//===================================扩展字段===============================================
|
||||
|
||||
@Schema(description = "样品状态")
|
||||
private String sampleStatus;
|
||||
}
|
||||
@@ -101,6 +101,8 @@ public class BusinessAssayTaskDataReqVO {
|
||||
//=== 扩展字段,判定上报状态
|
||||
@Schema(description = "判定上报状态")
|
||||
private String asmtReportedStatus;
|
||||
|
||||
|
||||
@Schema(description = "样品状态")
|
||||
private String sampleStatus;
|
||||
|
||||
}
|
||||
@@ -10,8 +10,10 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterD
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayParameterDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayProjectAndParameterRespVO;
|
||||
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.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectParameterDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryProjectDO;
|
||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -27,21 +29,20 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessAssayParameterDataReqVO reqVO) {
|
||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessAssayParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||
.selectAs(BusinessAssayParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||
.selectAs(BusinessAssayParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||
@@ -86,11 +87,22 @@ public interface BusinessAssayParameterDataMapper extends BaseMapperX<BusinessAs
|
||||
|
||||
default List<BusinessAssayParameterDataExtendRespVO> selectExtendByBusinessAssayProjectDataIds(List<Long> businessAssayProjectDataIds) {
|
||||
return selectJoinList(BusinessAssayParameterDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessAssayParameterDataDO::getDictionaryParameterId)
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.selectAll(BusinessAssayParameterDataDO.class)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayParameterDataExtendRespVO::getParameterName)
|
||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayParameterDataExtendRespVO::getParameterName)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayParameterDataExtendRespVO::getParameterKey)
|
||||
.in(BusinessAssayParameterDataDO::getBusinessAssayProjectDataId, businessAssayProjectDataIds));
|
||||
}
|
||||
|
||||
default BusinessAssayParameterDataDO selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(Long businessAssayTaskDataId, String projectSimpleName, String parameterKey) {
|
||||
return selectJoinOne(BusinessAssayParameterDataDO.class, new MPJLambdaWrapperX<BusinessAssayParameterDataDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessAssayParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.leftJoin(BusinessAssayProjectDataDO.class, BusinessAssayProjectDataDO::getId, BusinessAssayParameterDataDO::getBusinessAssayProjectDataId)
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessAssayProjectDataDO::getConfigAssayMethodProjectId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||
.eq(BusinessAssayProjectDataDO::getBusinessAssayTaskDataId, businessAssayTaskDataId)
|
||||
.eq(DictionaryProjectDO::getSimpleName, projectSimpleName)
|
||||
.eq(ConfigAssayMethodProjectParameterDO::getKey, parameterKey));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public interface BusinessAssayProjectDataMapper extends BaseMapperX<BusinessAssa
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessAssayProjectDataDO::getDictionaryProjectId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(BusinessAssayProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -39,83 +39,207 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface BusinessAssayTaskDataMapper extends BaseMapperX<BusinessAssayTaskDataDO> {
|
||||
|
||||
default List<BusinessAssayTaskDataExtendRespVO> selectList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||
.likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessAssayTaskDataDO::getId));
|
||||
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId);
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) {
|
||||
mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReporter())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAnalysisCount())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getRemark())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) {
|
||||
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus());
|
||||
}
|
||||
mpjLambdaWrapper.orderByDesc(BusinessAssayTaskDataDO::getId);
|
||||
return selectJoinList(BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper);
|
||||
}
|
||||
|
||||
default PageResult<BusinessAssayTaskDataExtendRespVO> selectPage(BusinessAssayTaskDataPageReqVO reqVO) {
|
||||
return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId)
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId())
|
||||
.likeIfPresent(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessAssayTaskDataDO::getId));
|
||||
MPJLambdaWrapper<BusinessAssayTaskDataDO> mpjLambdaWrapper = new MPJLambdaWrapperX<BusinessAssayTaskDataDO>()
|
||||
.leftJoin(ConfigAssayMethodDO.class, ConfigAssayMethodDO::getId, BusinessAssayTaskDataDO::getConfigAssayMethodId)
|
||||
.leftJoin(BusinessSubSampleDO.class, BusinessSubSampleDO::getId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.leftJoin(BusinessSubSampleAnalysisGroupDO.class, on -> on
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getBusinessSubSampleId, BusinessAssayTaskDataDO::getBusinessSubSampleId)
|
||||
.eq(BusinessSubSampleAnalysisGroupDO::getAssayDepartmentId, BusinessAssayTaskDataDO::getAssayDepartmentId))
|
||||
.selectAll(BusinessAssayTaskDataDO.class)
|
||||
.selectAs(ConfigAssayMethodDO::getName, BusinessAssayTaskDataExtendRespVO::getConfigAssayMethodName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleName, BusinessAssayTaskDataExtendRespVO::getSampleName)
|
||||
.selectAs(BusinessSubSampleDO::getSampleCode, BusinessAssayTaskDataExtendRespVO::getSampleCode)
|
||||
.selectAs(BusinessSubSampleDO::getSampleAssayCode, BusinessAssayTaskDataExtendRespVO::getSampleAssayCode)
|
||||
.selectAs(BusinessSubSampleDO::getConfigSubSampleId, BusinessAssayTaskDataExtendRespVO::getConfigSubSampleId);
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessBaseSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessBaseSampleId, reqVO.getBusinessBaseSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubParentSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleId, reqVO.getBusinessSubSampleId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigAssayMethodId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessAssayTaskId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, reqVO.getBusinessAssayTaskId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getBusinessSubSampleAssessmentId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getBusinessSubSampleAssessmentId, reqVO.getBusinessSubSampleAssessmentId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getTaskType())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getTaskType, reqVO.getTaskType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayType())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayType, reqVO.getAssayType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayProject())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayProject, reqVO.getAssayProject());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayDepartmentId, reqVO.getAssayDepartmentId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayDepartmentName())) {
|
||||
mpjLambdaWrapper.like(BusinessAssayTaskDataDO::getAssayDepartmentName, reqVO.getAssayDepartmentName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperator())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperator, reqVO.getAssayOperator());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssayOperatorId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAssayOperatorId, reqVO.getAssayOperatorId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getAssignTaskTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getAssignTaskTime, reqVO.getAssignTaskTime()[0], reqVO.getAssignTaskTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getIsAssignTasked())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsAssignTasked, reqVO.getIsAssignTasked());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getIsReported())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getIsReported, reqVO.getIsReported());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReporter())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporter, reqVO.getReporter());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReporterId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getReporterId, reqVO.getReporterId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getReportTime()) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getReportTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getReportTime, reqVO.getReportTime()[0], reqVO.getReportTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getConfigSampleFlowId())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getConfigSampleFlowId, reqVO.getConfigSampleFlowId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeKey())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSampleFlowNodeKey, reqVO.getSampleFlowNodeKey());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getSampleFlowNodeTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getSampleFlowNodeTime, reqVO.getSampleFlowNodeTime()[0], reqVO.getSampleFlowNodeTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getAnalysisCount())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getAnalysisCount, reqVO.getAnalysisCount());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getUpdateCount())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getUpdateCount, reqVO.getUpdateCount());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSystemDepartmentCode())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getCreateTime()) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[0]) && ObjectUtil.isNotEmpty(reqVO.getCreateTime()[1])) {
|
||||
mpjLambdaWrapper.between(BusinessAssayTaskDataDO::getCreateTime, reqVO.getCreateTime()[0], reqVO.getCreateTime()[1]);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getRemark())) {
|
||||
mpjLambdaWrapper.eq(BusinessAssayTaskDataDO::getRemark, reqVO.getRemark());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(reqVO.getSampleStatus())) {
|
||||
mpjLambdaWrapper.eq(BusinessSubSampleAnalysisGroupDO::getSampleStatus, reqVO.getSampleStatus());
|
||||
}
|
||||
mpjLambdaWrapper.orderByDesc(BusinessAssayTaskDataDO::getId);
|
||||
return selectJoinPage(reqVO, BusinessAssayTaskDataExtendRespVO.class, mpjLambdaWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientPa
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
|
||||
import com.zt.plat.module.qms.common.dic.dal.dataobject.DictionaryBusinessDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -41,21 +40,20 @@ public interface BusinessQCCoefficientParameterDataMapper extends BaseMapperX<Bu
|
||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCCoefficientParameterDataReqVO reqVO) {
|
||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCCoefficientParameterDataDO>()
|
||||
.leftJoin(ConfigQCSampleMethodParameterDO.class, ConfigQCSampleMethodParameterDO::getId, BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId)
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCCoefficientParameterDataDO::getDictionaryParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getConfigQCSampleMethodParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||
.selectAs(BusinessQCCoefficientParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||
.selectAs(ConfigQCSampleMethodParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||
|
||||
@@ -39,21 +39,20 @@ public interface BusinessQCManagementParameterDataMapper extends BaseMapperX<Bus
|
||||
default List<BusinessAssayProjectAndParameterRespVO> selectProjectAndParameterBy(BusinessQCManagementParameterDataReqVO reqVO) {
|
||||
return selectJoinList(BusinessAssayProjectAndParameterRespVO.class, new MPJLambdaWrapperX<BusinessQCManagementParameterDataDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectParameterDO.class, ConfigAssayMethodProjectParameterDO::getId, BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId)
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, BusinessQCManagementParameterDataDO::getDictionaryParameterId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getDictionaryParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(DictionaryParameterDO::getName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(DictionaryParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getConfigAssayMethodProjectParameterId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getParameterName, BusinessAssayProjectAndParameterRespVO::getShowName)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFillingWay, BusinessAssayProjectAndParameterRespVO::getFillingWay)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getDataType, BusinessAssayProjectAndParameterRespVO::getDataType)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getDecimalPosition, BusinessAssayProjectAndParameterRespVO::getDecimalPosition)
|
||||
.selectAs(BusinessQCManagementParameterDataDO::getValue, BusinessAssayProjectAndParameterRespVO::getValue)
|
||||
.selectAs(DictionaryParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getUnit, BusinessAssayProjectAndParameterRespVO::getUnit)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getIsNull, BusinessAssayProjectAndParameterRespVO::getIsNull)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getFormula, BusinessAssayProjectAndParameterRespVO::getFormula)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getSortNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getNo, BusinessAssayProjectAndParameterRespVO::getParamNo)
|
||||
.selectAs("'parameter'", BusinessAssayProjectAndParameterRespVO::getType)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessId, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessId)
|
||||
.selectAs(ConfigAssayMethodProjectParameterDO::getDictionaryBusinessKey, BusinessAssayProjectAndParameterRespVO::getGroupDictionaryBusinessKey)
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface BusinessQCManagementProjectDataMapper extends BaseMapperX<Busin
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessQCManagementProjectDataDO::getDictionaryProjectId)
|
||||
.leftJoin(DictionaryBusinessDO.class, DictionaryBusinessDO::getId, ConfigAssayMethodProjectDO::getDictionaryBusinessId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getId, BusinessAssayProjectAndParameterRespVO::getId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getDictionaryProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(BusinessQCManagementProjectDataDO::getConfigAssayMethodProjectId, BusinessAssayProjectAndParameterRespVO::getDicId)
|
||||
.selectAs(DictionaryProjectDO::getKey, BusinessAssayProjectAndParameterRespVO::getDicKey)
|
||||
//.selectAs(DictionaryProjectDO::getName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
.selectAs(DictionaryProjectDO::getSimpleName, BusinessAssayProjectAndParameterRespVO::getName)
|
||||
|
||||
@@ -82,6 +82,25 @@ public interface BusinessSampleEntrustDetailMapper extends BaseMapperX<BusinessS
|
||||
default List<BusinessSampleEntrustDetailDO> selectByBusinessSampleEntrustRegistrationId(Long businessSampleEntrustRegistrationId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustRegistrationId));
|
||||
}
|
||||
|
||||
default BusinessSampleEntrustDetailDO selectByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>().eq(BusinessSampleEntrustDetailDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前批次的第一条数据
|
||||
* @param businessBaseSampleId 任意一条的主样id
|
||||
* @return
|
||||
*/
|
||||
default BusinessSampleEntrustDetailDO selectCurrBatchFirstByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = selectByBusinessBaseSampleId(businessBaseSampleId);
|
||||
//查询当前委托的第一条
|
||||
return selectOne(new LambdaQueryWrapperX<BusinessSampleEntrustDetailDO>()
|
||||
.eq(BusinessSampleEntrustDetailDO::getBusinessSampleEntrustRegistrationId, businessSampleEntrustDetailDO.getBusinessSampleEntrustRegistrationId())
|
||||
.orderByAsc(BusinessSampleEntrustDetailDO::getSort)
|
||||
.last(" limit 1 "));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 物理批量删除删除
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface BusinessSubParentSampleAssessmentProjectMapper extends BaseMapp
|
||||
.orderByDesc(BusinessSubParentSampleAssessmentProjectDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleAssessmentProjectExtendRespVO> selectByBusinessSubParentSampleIdAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
default List<BusinessSubParentSampleAssessmentProjectExtendRespVO> selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(List<Long> businessSubParentSampleIds, Long configAssayMethodId) {
|
||||
return selectJoinList(BusinessSubParentSampleAssessmentProjectExtendRespVO.class, new MPJLambdaWrapperX<BusinessSubParentSampleAssessmentProjectDO>()
|
||||
.leftJoin(ConfigAssayMethodProjectDO.class, ConfigAssayMethodProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getConfigAssayMethodProjectId)
|
||||
.leftJoin(DictionaryProjectDO.class, DictionaryProjectDO::getId, BusinessSubParentSampleAssessmentProjectDO::getDictionaryProjectId)
|
||||
|
||||
@@ -5,6 +5,9 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSamplePageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
@@ -37,5 +40,10 @@ public interface BusinessSubParentSampleMapper extends BaseMapperX<BusinessSubPa
|
||||
.eqIfPresent(BusinessSubParentSampleDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessSubParentSampleDO::getId));
|
||||
}
|
||||
|
||||
default List<BusinessSubParentSampleDO> selectByBusinessBaseSampleId(Long businessBaseSampleId) {
|
||||
return selectList(new LambdaQueryWrapperX<BusinessSubParentSampleDO>()
|
||||
.eq(BusinessSubParentSampleDO::getBusinessBaseSampleId, businessBaseSampleId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
@@ -44,6 +46,8 @@ 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.liteflow.param.SampleFlowInfo;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
||||
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.dal.dataobject.BaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectDO;
|
||||
@@ -179,23 +183,23 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<BusinessSampleAssayResultDO> sampleAssayResultList = sampleEntrustContext.getSampleAssayResultList();
|
||||
|
||||
//金银检测项目字典id列表
|
||||
List<Long> auAgDictionaryProjectIdList = new ArrayList<>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
add(1000000000000000002L);
|
||||
add(1000000000000000003L);
|
||||
}};
|
||||
// List<Long> auAgDictionaryProjectIdList = new ArrayList<>() {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// {
|
||||
// add(1000000000000000002L);
|
||||
// add(1000000000000000003L);
|
||||
// }};
|
||||
//硫的检测项目字典id
|
||||
Long sDictionaryProjectId = 1000000000000000004L;
|
||||
// Long sDictionaryProjectId = 1000000000000000004L;
|
||||
|
||||
//商检样品来源id
|
||||
List<Long> sjEntrustSourceIdList = new ArrayList<>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
add(1000000000000000002L);//中铜国贸
|
||||
}};
|
||||
// List<Long> sjEntrustSourceIdList = new ArrayList<>() {
|
||||
// private static final long serialVersionUID = 1L;
|
||||
//
|
||||
// {
|
||||
// add(1000000000000000002L);//中铜国贸
|
||||
// }};
|
||||
|
||||
//样品大类列表
|
||||
List<BaseSampleDO> baseSampleList = baseSampleMapper.selectList();
|
||||
@@ -250,11 +254,11 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
List<BusinessAssayReportDataDO> businessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
//是否为商检委托
|
||||
Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId());
|
||||
// Boolean isSjEntrust = sjEntrustSourceIdList.contains(sampleEntrustRegistration.getConfigEntrustSourceId());
|
||||
//是否分析金银
|
||||
Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId()));
|
||||
// Boolean isAssayAuAg = sampleEntrustProjectList.stream().anyMatch(f -> auAgDictionaryProjectIdList.contains(f.getDictionaryProjectId()));
|
||||
//是否分析硫
|
||||
Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId));
|
||||
// Boolean isAssayS = sampleEntrustProjectList.stream().anyMatch(f -> f.getDictionaryProjectId().equals(sDictionaryProjectId));
|
||||
|
||||
//子样流转信息列表
|
||||
List<SampleFlowInfo> sampleFlowInfoList = new ArrayList<>();
|
||||
@@ -295,26 +299,26 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
|
||||
|
||||
//是否创建综合样S分析
|
||||
Boolean isCreateZhy = false;
|
||||
// Boolean isCreateZhy = false;
|
||||
//综合样分析方法
|
||||
ConfigAssayMethodDO configAssayMethodZhy = null;
|
||||
// ConfigAssayMethodDO configAssayMethodZhy = null;
|
||||
|
||||
//是商检样品,分析金银,第一个样品
|
||||
if (isSjEntrust && isAssayAuAg && sort == 0) {
|
||||
// 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());
|
||||
}
|
||||
|
||||
}
|
||||
// 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());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@@ -440,6 +444,140 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
//查询子样对应的分析方法
|
||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodList.stream().filter(f -> f.getIsDefaultUse().equals(QmsCommonConstant.YES) && f.getConfigAssayMethodId().equals(configAssayMethodId) && f.getConfigSubSampleId().equals(configSubSample.getId())).findFirst().orElse(null);
|
||||
|
||||
//扩展配置信息
|
||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
ConfigSubSampleMethodConfAdd addAssayTask = configSubSampleMethodConfInfo.getAddAssayTask();
|
||||
if (addAssayTask != null) {//需要添加任务
|
||||
|
||||
List<Long> conditionProjectIdList = addAssayTask.getConditionProjectIdList();
|
||||
Long methodId = addAssayTask.getMethodId();
|
||||
List<Long> projectIdList = addAssayTask.getProjectIdList();
|
||||
//判定检测项目包含条件中的检测项目
|
||||
Boolean isAssayConditionProjectList = sampleEntrustProjectList.stream().anyMatch(f -> conditionProjectIdList.contains(f.getDictionaryProjectId()));
|
||||
if (isAssayConditionProjectList && sort == 0) {
|
||||
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<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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
businessSubSampleAnalysisGroupDO = businessSubSampleAnalysisGroupDOList.stream().filter(f -> f.getBusinessSubSampleId().equals(businessSubSampleDO.getId()) && f.getAssayDepartmentId().equals(configAssayMethodDO.getAssayDepartmentId())).findFirst().orElse(null);
|
||||
if (businessSubSampleAnalysisGroupDO == null) {
|
||||
businessSubSampleAnalysisGroupDO = new BusinessSubSampleAnalysisGroupDO();
|
||||
@@ -482,7 +620,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
//根据检测方法循环
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
//子样检测任务
|
||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||
@@ -523,9 +661,9 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayProjectDataDO.setDataType(configAssayMethodProjectDO.getDataType());
|
||||
businessAssayProjectDataDO.setDecimalPosition(configAssayMethodProjectDO.getDecimalPosition());
|
||||
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);
|
||||
}
|
||||
// if (isSjEntrust && isAssayAuAg && sort == 0 && !isCreateZhy && sDictionaryProjectId.equals(configAssayMethodProjectDO.getDictionaryProjectId())) {//是商检样品,分析金银,第一个样品,不创建综合样,并且是S值
|
||||
// businessAssayProjectDataDO.setUsage(QmsCommonConstant.ASSAY_PROJECT_USAGE_INGREDIENT_REPORT);
|
||||
// }
|
||||
|
||||
businessAssayProjectDataDO.setMinimumLimitValue(configAssayMethodProjectDO.getMinimumLimitValue());
|
||||
businessAssayProjectDataDO.setIsEnabled(1);
|
||||
@@ -556,6 +694,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
//判定是商检 分析金银 需要创建综合样,样品为第1个
|
||||
if (isSjEntrust && isAssayAuAg && sort == 0 && isCreateZhy && configAssayMethodZhy != null) {
|
||||
Long configAssayMethodIdZhy = configAssayMethodZhy.getId();
|
||||
@@ -595,6 +734,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
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);
|
||||
@@ -605,7 +745,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
//根据检测方法循环
|
||||
BusinessAssayTaskDataDO businessAssayTaskDataDO = null;
|
||||
//根据任务数循环
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
for (int i = 0; i < configSubSampleMethodDO.getTaskCount(); i++) {
|
||||
//子样检测任务
|
||||
businessAssayTaskDataDO = new BusinessAssayTaskDataDO();
|
||||
businessAssayTaskDataDO.setId(IdWorker.getId());
|
||||
@@ -661,6 +801,7 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessAssayTaskDataDOList.add(businessAssayTaskDataDO);
|
||||
}
|
||||
}
|
||||
**/
|
||||
sort++;
|
||||
}
|
||||
|
||||
@@ -679,43 +820,33 @@ public class SampleEntrustGenSampleDataCmp extends NodeComponent {
|
||||
businessSampleAssayResultMapper.updateBatch(sampleAssayResultList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessBaseSampleDOList)) {
|
||||
log.info("插入 businessBaseSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessBaseSampleMapper.insertBatch(businessBaseSampleDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessSubParentSampleDOList)) {
|
||||
log.info("插入 businessSubParentSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessSubParentSampleMapper.insertBatch(businessSubParentSampleDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessSubParentSampleAssessmentDOList)) {
|
||||
log.info("插入 businessSubParentSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessSubParentSampleAssessmentMapper.insertBatch(businessSubParentSampleAssessmentDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessSubSampleDOList)) {
|
||||
log.info("插入 businessSubSampleDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessSubSampleMapper.insertBatch(businessSubSampleDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessSubSampleAnalysisGroupDOList)) {
|
||||
log.info("插入 businessSubSampleAnalysisGroupDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessSubSampleAnalysisGroupMapper.insertBatch(businessSubSampleAnalysisGroupDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessSubSampleAssessmentDOList)) {
|
||||
log.info("插入 businessSubSampleAssessmentDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessSubSampleAssessmentMapper.insertBatch(businessSubSampleAssessmentDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayTaskDataDOList)) {
|
||||
log.info("插入 businessAssayTaskDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessAssayTaskDataMapper.insertBatch(businessAssayTaskDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayProjectDataDOList)) {
|
||||
log.info("插入 businessAssayProjectDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessAssayProjectDataMapper.insertBatch(businessAssayProjectDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayParameterDataDOList)) {
|
||||
log.info("插入 businessAssayParameterDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessAssayParameterDataMapper.insertBatch(businessAssayParameterDataDOList);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(businessAssayReportDataDOList)) {
|
||||
log.info("插入 businessAssayReportDataDOList 前 tenant_id = {}", TenantContextHolder.getTenantId());
|
||||
businessAssayReportDataMapper.insertBatch(businessAssayReportDataDOList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class SampleSimpleEncryptCmp extends NodeComponent {
|
||||
String simpleCode = sequenceUtil.genCode(simpleCodeRule);
|
||||
businessSubSampleDO.setSampleAssayCode(simpleCode);
|
||||
businessSubSampleDO.setSampleReturnCode(simpleCode);
|
||||
businessSubSampleDO.setIsGenerateReturnCode(QmsCommonConstant.YES);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class BusinessAssayTaskDataServiceImpl implements BusinessAssayTaskDataSe
|
||||
|
||||
@Override
|
||||
public List<BusinessAssayTaskDataGroupRespVO> getUnAssayTaskGroupList(BusinessAssayTaskDataReqVO reqVO) {
|
||||
System.out.println("查询时租户id:" + TenantContextHolder.getTenantId());
|
||||
// System.out.println("查询时租户id:" + TenantContextHolder.getTenantId());
|
||||
return businessAssayTaskDataMapper.selectUnAssayTaskGroupList(reqVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,15 +6,6 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
/**
|
||||
* <b>SampleAnalysisAuditService</b>
|
||||
* <p>
|
||||
* 更新历史:
|
||||
* <pre> 版本 更新时间 更新者 更新内容<hr/>
|
||||
* V1.0 2025年9月29日 wxr Add</pre>
|
||||
* <b>Copyright (C) 云南志者竟成科技有限公司</b>
|
||||
* </p>
|
||||
* @author 王兴荣<wxr@wangxingrong.com>
|
||||
* @version V1.0
|
||||
* @since 2025年9月29日
|
||||
*/
|
||||
public interface SampleAnalysisAuditService {
|
||||
|
||||
|
||||
@@ -5,14 +5,6 @@ import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
|
||||
/**
|
||||
* <b>SampleAnalysisService</b>
|
||||
* <p>
|
||||
* 更新历史:
|
||||
* <pre> 版本 更新时间 更新者 更新内容<hr/>
|
||||
* V1.0 2025年9月22日 wxr Add</pre>
|
||||
* <b>Copyright (C) 云南志者竟成科技有限公司</b>
|
||||
* </p>
|
||||
* @author 王兴荣<wxr@wangxingrong.com>
|
||||
* @version V1.0
|
||||
* @since 2025年9月22日
|
||||
*/
|
||||
public interface SampleAnalysisService {
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -35,6 +36,7 @@ import com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataEx
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCCoefficientParameterDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementParameterDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessQCManagementProjectDataReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentProjectExtendRespVO;
|
||||
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.BusinessAssayTaskDO;
|
||||
@@ -45,6 +47,8 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCCoefficientP
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementParameterDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessQCManagementProjectDataDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustDetailDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||
@@ -56,6 +60,9 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCCoefficientParam
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessQCManagementProjectDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSampleEntrustDetailMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentProjectMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.BusinessAssayTaskAnalysisDataRespVO;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.ConfigAssayMethodProjectCoefficientRespVO;
|
||||
@@ -132,6 +139,15 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
@Resource
|
||||
private BusinessQCManagementParameterDataMapper businessQCManagementParameterDataMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSampleEntrustDetailMapper businessSampleEntrustDetailMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleMapper businessSubParentSampleMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentProjectMapper businessSubParentSampleAssessmentProjectMapper;
|
||||
|
||||
@Resource
|
||||
private DataCollectionService dataCollectionService;
|
||||
|
||||
@@ -452,6 +468,19 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
|
||||
List<BusinessAssayTaskDetailDO> businessAssayTaskDetailList = businessAssayTaskDetailMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDetailDO>().eq(BusinessAssayTaskDetailDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()));
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataList = businessAssayTaskDataMapper.selectList(new LambdaQueryWrapperX<BusinessAssayTaskDataDO>().eq(BusinessAssayTaskDataDO::getBusinessAssayTaskId, businessAssayTaskDO.getId()).eq(BusinessAssayTaskDataDO::getConfigAssayMethodId, businessAssayTaskDO.getConfigAssayMethodId()));
|
||||
|
||||
//子样Id列表
|
||||
List<Long> businessSubSampleIdList = businessAssayTaskDataList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//子样列表
|
||||
List<BusinessSubSampleDO> businessSubSampleDOList = businessSubSampleMapper.selectByIds(businessSubSampleIdList);
|
||||
//子样配置id列表
|
||||
List<Long> configSubSampleIdList = businessSubSampleDOList.stream().map(m -> m.getConfigSubSampleId()).distinct().collect(Collectors.toList());
|
||||
|
||||
//子样方法配置列表
|
||||
List<ConfigSubSampleMethodDO> configSubSampleMethodDOList = configSubSampleMethodMapper.selectByConfigSubSampleIdsAndConfigAssayMethodId(configSubSampleIdList, businessAssayTaskDO.getConfigAssayMethodId());
|
||||
|
||||
|
||||
List<Long> businessAssayTaskDataIdList = businessAssayTaskDataList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
// BusinessAssayTaskDataDO businessAssayTaskData = businessAssayTaskDataList.get(0);
|
||||
|
||||
@@ -507,6 +536,62 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
List<Map<String, Object>> datas = new ArrayList<>();
|
||||
for (BusinessAssayTaskDataDO businessAssayTaskDataDO : businessAssayTaskDataList) {
|
||||
BusinessAssayTaskDetailDO businessAssayTaskDetailDO = businessAssayTaskDetailList.stream().filter(f -> f.getBusinessAssayTaskDataId().equals(businessAssayTaskDataDO.getId())).findFirst().orElse(null);
|
||||
|
||||
BusinessSubSampleDO businessSubSampleDO = businessSubSampleDOList.stream().filter(f -> f.getId().equals(businessAssayTaskDataDO.getBusinessSubSampleId())).findFirst().orElse(null);
|
||||
ConfigSubSampleMethodDO configSubSampleMethodDO = configSubSampleMethodDOList.stream().filter(f -> f.getConfigAssayMethodId().equals(businessAssayTaskDataDO.getConfigAssayMethodId()) && f.getConfigSubSampleId().equals(businessSubSampleDO.getConfigSubSampleId())).findFirst().orElse(null);
|
||||
String configInfomation = configSubSampleMethodDO.getConfigInfomation();
|
||||
if (StringUtils.isNotBlank(configInfomation)) {
|
||||
ConfigSubSampleMethodConfInfo configSubSampleMethodConfInfo = JSON.parseObject(configInfomation, ConfigSubSampleMethodConfInfo.class);
|
||||
List<ConfigSubSampleMethodConfItem> getParamList = configSubSampleMethodConfInfo.getGetParam();
|
||||
for (ConfigSubSampleMethodConfItem configSubSampleMethodConfItem: getParamList) {
|
||||
//Boolean required = configSubSampleMethodConfItem.getRequired();//是否必须
|
||||
ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource();//来源
|
||||
Long configMethodId = source.getMethodId();
|
||||
String sourceProject = source.getProject();
|
||||
//String sourceParameter = source.getParameter();
|
||||
|
||||
|
||||
ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget();//目标
|
||||
String targetProject = target.getProject();
|
||||
String targetParameter = target.getParameter();
|
||||
|
||||
BusinessAssayParameterDataDO businessAssayParameterDataDO = businessAssayParameterDataMapper.selectByBusinessAssayTaskDataIdAndProjectSimpleNameAndParameterKey(businessAssayTaskDataDO.getId(), targetProject, targetParameter);
|
||||
if (StringUtils.isBlank(businessAssayParameterDataDO.getValue())) {
|
||||
//1 查询来源品位
|
||||
BusinessSampleEntrustDetailDO businessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
String forecastResult = businessSampleEntrustDetailDO.getForecastResult();//预报品位
|
||||
if (StringUtils.isBlank(forecastResult)) {
|
||||
//2 查询当前样品其他分析方法的结果 (废弃-20251202)
|
||||
// List<Long> businessSubParentSampleIdList = Arrays.asList(businessAssayTaskDataDO.getBusinessSubParentSampleId());
|
||||
// List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIdList, configMethodId);
|
||||
// BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
// if (businessSubParentSampleAssessmentProject == null || StringUtils.isBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
|
||||
//3 查询当前批次委托的第一个样品对应的分析方法的结果
|
||||
BusinessSampleEntrustDetailDO currBatchFirstBusinessSampleEntrustDetailDO = businessSampleEntrustDetailMapper.selectCurrBatchFirstByBusinessBaseSampleId(businessAssayTaskDataDO.getBusinessBaseSampleId());
|
||||
List<BusinessSubParentSampleDO> currBusinessSubParentSampleDOList = businessSubParentSampleMapper.selectByBusinessBaseSampleId(currBatchFirstBusinessSampleEntrustDetailDO.getBusinessBaseSampleId());
|
||||
List<Long> currBusinessSubParentSampleIdList = currBusinessSubParentSampleDOList.stream().map(m -> m.getId()).collect(Collectors.toList());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentProjectList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(currBusinessSubParentSampleIdList, configMethodId);
|
||||
BusinessSubParentSampleAssessmentProjectExtendRespVO businessSubParentSampleAssessmentProject = businessSubParentSampleAssessmentProjectList.stream().filter(f -> f.getSimpleName().equals(sourceProject)).findFirst().orElse(null);
|
||||
if (businessSubParentSampleAssessmentProject != null && StringUtils.isNotBlank(businessSubParentSampleAssessmentProject.getAssessmentValue())) {
|
||||
businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
}
|
||||
// } else {
|
||||
// businessAssayParameterDataDO.setValue(businessSubParentSampleAssessmentProject.getAssessmentValue());
|
||||
// }
|
||||
|
||||
|
||||
} else {
|
||||
JSONObject forecastResultJson = JSON.parseObject(forecastResult);
|
||||
|
||||
|
||||
}
|
||||
|
||||
businessAssayParameterDataMapper.updateById(businessAssayParameterDataDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Map<String, Object> map = new HashedMap<>();
|
||||
map.put("businessAssayTaskDataId", businessAssayTaskDataDO.getId());
|
||||
@@ -1030,7 +1115,7 @@ public class SampleAnalysisServiceImpl implements SampleAnalysisService {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
businessAssayTaskDO.setIngredientsStatus(QmsCommonConstant.IN_PROGRESS);
|
||||
businessAssayTaskMapper.updateById(businessAssayTaskDO);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
//分样id列表
|
||||
List<Long> businessSubParentSampleIds = noReportSubParentSampleAssessmentRespList.stream().map(m -> m.getBusinessSubParentSampleId()).collect(Collectors.toList());
|
||||
//报送的检测项目数据
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentDOList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
//获取分析任务数
|
||||
List<BusinessAssayTaskDataDO> businessAssayTaskDataDOList = businessAssayTaskDataMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(businessSubParentSampleIds, configAssayMethodId);
|
||||
List<Long> businessSubSampleIds = businessAssayTaskDataDOList.stream().map(m -> m.getBusinessSubSampleId()).distinct().collect(Collectors.toList());
|
||||
@@ -440,7 +440,7 @@ public class SampleResultReportingServiceImpl implements SampleResultReportingSe
|
||||
List<BusinessAssayReportDataDO> saveBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
List<BusinessAssayReportDataDO> updateBusinessAssayReportDataDOList = new ArrayList<>();
|
||||
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
List<BusinessSubParentSampleAssessmentProjectExtendRespVO> businessSubParentSampleAssessmentExtendList = businessSubParentSampleAssessmentProjectMapper.selectByBusinessSubParentSampleIdsAndConfigAssayMethodId(reqVO.getBusinessSubParentSampleIds(), reqVO.getConfigAssayMethodId());
|
||||
|
||||
List<BusinessSubParentSampleDO> businessSubParentSampleDOList = businessSubParentSampleMapper.selectByIds(reqVO.getBusinessSubParentSampleIds());
|
||||
|
||||
|
||||
@@ -70,6 +70,10 @@ public class MaterialAssayStandardController implements BusinessControllerMarker
|
||||
@Operation(summary = "更新检测标准")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard:update')")
|
||||
public CommonResult<Boolean> updateMaterialAssayStandard(@Valid @RequestBody MaterialAssayStandardSaveReqVO updateReqVO) {
|
||||
Long id = updateReqVO.getId();
|
||||
MaterialAssayStandardDO entity = materialAssayStandardService.getMaterialAssayStandard(id);
|
||||
if("tempDataKey".equals(entity.getRemark()))
|
||||
updateReqVO.setRemark("");
|
||||
materialAssayStandardService.updateMaterialAssayStandard(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,14 @@ public class MaterialAssayStandardDetailController implements BusinessController
|
||||
return success(jsonArray);
|
||||
}
|
||||
|
||||
@GetMapping("/getByStandardId")
|
||||
@Operation(summary = "获得物料检测标准检测项目分页")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:query')")
|
||||
public CommonResult<List<MaterialAssayStandardDetailRespVO>> getByStandardId(@Valid MaterialAssayStandardDetailPageReqVO pageReqVO) {
|
||||
List<MaterialAssayStandardDetailRespVO> list = materialAssayStandardDetailService.getByStandardId(pageReqVO.getMaterialAssayStandardId());
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建物料检测标准检测项目")
|
||||
//@PreAuthorize("@ss.hasPermission('qms:material-assay-standard-detail:create')")
|
||||
|
||||
@@ -19,6 +19,27 @@ public class ConfigAssayMethodProjectParameterPageReqVO extends PageParam {
|
||||
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "1283")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "2")
|
||||
private String dataType;
|
||||
|
||||
|
||||
@@ -24,6 +24,27 @@ public class ConfigAssayMethodProjectParameterRespVO {
|
||||
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
||||
private String dataType;
|
||||
|
||||
@@ -20,6 +20,27 @@ public class ConfigAssayMethodProjectParameterSaveReqVO {
|
||||
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
||||
private String dataType;
|
||||
|
||||
@@ -1,23 +1,8 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigQCSampleMethodParameterExtendRespVO extends ConfigQCSampleMethodParameterRespVO {
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer dictionaryParameterNo;
|
||||
|
||||
@Schema(description = "名称", example = "王五")
|
||||
private String dictionaryParameterName;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String dictionaryParameterKey;
|
||||
|
||||
@Schema(description = "检测单位ID,UNT表", example = "20894")
|
||||
private Long dictionaryParameterUnitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String dictionaryParameterUnit;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,27 @@ public class ConfigQCSampleMethodParameterPageReqVO extends PageParam {
|
||||
@Schema(description = "参数ID,字典表【T_DIC_PRM】", example = "29135")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算")
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", example = "1")
|
||||
private String dataType;
|
||||
|
||||
|
||||
@@ -24,6 +24,27 @@ public class ConfigQCSampleMethodParameterRespVO {
|
||||
@ExcelProperty("参数ID,字典表【T_DIC_PRM】")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间")
|
||||
private String dataType;
|
||||
|
||||
@@ -20,6 +20,27 @@ public class ConfigQCSampleMethodParameterSaveReqVO {
|
||||
@NotNull(message = "参数ID,字典表【T_DIC_PRM】不能为空")
|
||||
private Long dictionaryParameterId;
|
||||
|
||||
@Schema(description = "参数名称", example = "李四")
|
||||
private String parameterName;
|
||||
|
||||
@Schema(description = "参数简称", example = "李四")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "参数序号")
|
||||
private Integer no;
|
||||
|
||||
@Schema(description = "键值")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "单位ID,UNT表", example = "31081")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String fillingWay;
|
||||
|
||||
@Schema(description = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间不能为空")
|
||||
private String dataType;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigSubSampleMethodConfAdd {
|
||||
|
||||
/** 分析方法id **/
|
||||
private Long methodId;
|
||||
|
||||
/** 检测项目 **/
|
||||
private List<Long> projectIdList;
|
||||
|
||||
/** 条件 需要存在分析的检测项目,才添加分析方法 **/
|
||||
private List<Long> conditionProjectIdList;
|
||||
|
||||
}
|
||||
@@ -6,6 +6,9 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConfigSubSampleMethodConfInfo {
|
||||
|
||||
/** 添加分析任务 **/
|
||||
private ConfigSubSampleMethodConfAdd addAssayTask;
|
||||
|
||||
/** 分析方法参数取值配置 **/
|
||||
private List<ConfigSubSampleMethodConfItem> getParam;
|
||||
|
||||
@@ -42,6 +42,41 @@ public class ConfigAssayMethodProjectParameterDO extends BusinessBaseDO {
|
||||
@TableField("DIC_PRM_ID")
|
||||
private Long dictionaryParameterId;
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableField("PRM_NAME")
|
||||
private String parameterName;
|
||||
/**
|
||||
* 参数简称
|
||||
*/
|
||||
@TableField("SHRT_NAME")
|
||||
private String shortName;
|
||||
/**
|
||||
* 参数序号
|
||||
*/
|
||||
@TableField("NO")
|
||||
private Integer no;
|
||||
/**
|
||||
* 键值
|
||||
*/
|
||||
@TableField("KY")
|
||||
private String key;
|
||||
/**
|
||||
* 单位ID,UNT表
|
||||
*/
|
||||
@TableField("UNT_ID")
|
||||
private Long unitId;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
/**
|
||||
* 填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算
|
||||
*/
|
||||
@TableField("FIL_WY")
|
||||
private String fillingWay;
|
||||
/**
|
||||
* 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
|
||||
@@ -42,6 +42,41 @@ public class ConfigQCSampleMethodParameterDO extends BusinessBaseDO {
|
||||
@TableField("DIC_PRM_ID")
|
||||
private Long dictionaryParameterId;
|
||||
/**
|
||||
* 参数名称
|
||||
*/
|
||||
@TableField("PRM_NAME")
|
||||
private String parameterName;
|
||||
/**
|
||||
* 参数简称
|
||||
*/
|
||||
@TableField("SHRT_NAME")
|
||||
private String shortName;
|
||||
/**
|
||||
* 参数序号
|
||||
*/
|
||||
@TableField("NO")
|
||||
private Integer no;
|
||||
/**
|
||||
* 键值
|
||||
*/
|
||||
@TableField("KY")
|
||||
private String key;
|
||||
/**
|
||||
* 单位ID,UNT表
|
||||
*/
|
||||
@TableField("UNT_ID")
|
||||
private Long unitId;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
/**
|
||||
* 填写方式,字典表【T_DIC_BSN】,keyboard-人工数字键盘录入,input-人工文本录入,collect-天平采集,calculate-计算
|
||||
*/
|
||||
@TableField("FIL_WY")
|
||||
private String fillingWay;
|
||||
/**
|
||||
* 数据类型,【字典】【jy_sample_data_type】字符串,整数,小数,日期,时间
|
||||
*/
|
||||
@TableField("DAT_TP")
|
||||
|
||||
@@ -25,6 +25,13 @@ public interface ConfigAssayMethodProjectParameterMapper extends BaseMapperX<Con
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigAssayMethodProjectParameterDO>()
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())
|
||||
.likeIfPresent(ConfigAssayMethodProjectParameterDO::getParameterName, reqVO.getParameterName())
|
||||
.likeIfPresent(ConfigAssayMethodProjectParameterDO::getShortName, reqVO.getShortName())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getKey, reqVO.getKey())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getUnitId, reqVO.getUnitId())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getFillingWay, reqVO.getFillingWay())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(ConfigAssayMethodProjectParameterDO::getDefaultValue, reqVO.getDefaultValue())
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigQCSampleMethodParameterDO;
|
||||
import com.zt.plat.module.qms.business.dic.dal.dataobject.DictionaryParameterDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@@ -23,6 +22,13 @@ public interface ConfigQCSampleMethodParameterMapper extends BaseMapperX<ConfigQ
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigQCSampleMethodParameterDO>()
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, reqVO.getConfigQCSampleMethodId())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getDictionaryParameterId, reqVO.getDictionaryParameterId())
|
||||
.likeIfPresent(ConfigQCSampleMethodParameterDO::getParameterName, reqVO.getParameterName())
|
||||
.likeIfPresent(ConfigQCSampleMethodParameterDO::getShortName, reqVO.getShortName())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getKey, reqVO.getKey())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getUnitId, reqVO.getUnitId())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getFillingWay, reqVO.getFillingWay())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(ConfigQCSampleMethodParameterDO::getDefaultValue, reqVO.getDefaultValue())
|
||||
@@ -39,25 +45,11 @@ public interface ConfigQCSampleMethodParameterMapper extends BaseMapperX<ConfigQ
|
||||
|
||||
default List<ConfigQCSampleMethodParameterExtendRespVO> selectByConfigQCSampleMethodId(Long configQCSampleMethodId) {
|
||||
return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX<ConfigQCSampleMethodParameterDO>()
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId)
|
||||
.selectAll(ConfigQCSampleMethodParameterDO.class)
|
||||
.selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey)
|
||||
.selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName)
|
||||
.selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo)
|
||||
.selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId)
|
||||
.selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit)
|
||||
.eq(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodId));
|
||||
}
|
||||
|
||||
default List<ConfigQCSampleMethodParameterExtendRespVO> selectByConfigQCSampleMethodIds(List<Long> configQCSampleMethodIds) {
|
||||
return selectJoinList(ConfigQCSampleMethodParameterExtendRespVO.class, new MPJLambdaWrapperX<ConfigQCSampleMethodParameterDO>()
|
||||
.leftJoin(DictionaryParameterDO.class, DictionaryParameterDO::getId, ConfigQCSampleMethodParameterDO::getDictionaryParameterId)
|
||||
.selectAll(ConfigQCSampleMethodParameterDO.class)
|
||||
.selectAs(DictionaryParameterDO::getKey, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterKey)
|
||||
.selectAs(DictionaryParameterDO::getName, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterName)
|
||||
.selectAs(DictionaryParameterDO::getNo, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterNo)
|
||||
.selectAs(DictionaryParameterDO::getUnitId, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnitId)
|
||||
.selectAs(DictionaryParameterDO::getUnit, ConfigQCSampleMethodParameterExtendRespVO::getDictionaryParameterUnit)
|
||||
.in(ConfigQCSampleMethodParameterDO::getConfigQCSampleMethodId, configQCSampleMethodIds));
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@ import com.zt.plat.framework.common.pojo.PageResult;
|
||||
public interface ConfigWarehouseLocationService {
|
||||
|
||||
ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType);
|
||||
ConfigWarehouseLocationDO getByCode(String code);
|
||||
|
||||
void checkCodeUnique(ConfigWarehouseLocationSaveReqVO reqVo);
|
||||
void checkCodeUniqueWithoutId(ConfigWarehouseLocationSaveReqVO reqVo);
|
||||
|
||||
//保存数据
|
||||
ConfigWarehouseLocationRespVO save(@Valid ConfigWarehouseLocationSaveReqVO reqVO);
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zt.plat.module.qms.enums.QmsPermissionConstant;
|
||||
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
@@ -42,11 +43,15 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
|
||||
Long id = reqVo.getId();
|
||||
//处理权限
|
||||
List<ConfigPermissionSaveReqVO> primissionList = reqVo.getPermissionList();
|
||||
ConfigWarehouseLocationDO entity = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class);
|
||||
if(id == null){
|
||||
ConfigWarehouseLocationDO entity = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class);
|
||||
checkCodeUniqueWithoutId(reqVo);
|
||||
configWarehouseLocationMapper.insert(entity);
|
||||
id = entity.getId();
|
||||
reqVo.setId( id);
|
||||
}else {
|
||||
checkCodeUnique(reqVo);
|
||||
configWarehouseLocationMapper.updateById(entity);
|
||||
}
|
||||
for(ConfigPermissionSaveReqVO permission : primissionList){
|
||||
permission.setSourceId( id);
|
||||
@@ -60,7 +65,8 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
|
||||
public ConfigWarehouseLocationDO getLocationByCode(String code, String warehouseType) {
|
||||
LambdaQueryWrapper<ConfigWarehouseLocationDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(ConfigWarehouseLocationDO::getCode, code);
|
||||
query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType);
|
||||
if(!ObjectUtils.isEmpty(warehouseType))
|
||||
query.eq(ConfigWarehouseLocationDO::getWarehouseType, warehouseType);
|
||||
query.eq(ConfigWarehouseLocationDO::getDataType, QmsWarehouseLocationConstant.DATA_TYPE_LOCATION);
|
||||
// query.last("limit 1");
|
||||
List<ConfigWarehouseLocationDO> list = configWarehouseLocationMapper.selectList(query);
|
||||
@@ -72,23 +78,63 @@ public class ConfigWarehouseLocationServiceImpl implements ConfigWarehouseLocati
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO createReqVO) {
|
||||
public ConfigWarehouseLocationDO getByCode(String code) {
|
||||
LambdaQueryWrapper<ConfigWarehouseLocationDO> query = new LambdaQueryWrapper<>();
|
||||
query.eq(ConfigWarehouseLocationDO::getCode, code);
|
||||
List<ConfigWarehouseLocationDO> list = configWarehouseLocationMapper.selectList(query);
|
||||
if(list.size() > 1)
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE);
|
||||
if(list.isEmpty())
|
||||
return null;
|
||||
return list.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigWarehouseLocationRespVO createConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO reqVo) {
|
||||
// 插入
|
||||
ConfigWarehouseLocationDO configWarehouseLocation = BeanUtils.toBean(createReqVO, ConfigWarehouseLocationDO.class);
|
||||
checkCodeUniqueWithoutId(reqVo);
|
||||
ConfigWarehouseLocationDO configWarehouseLocation = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class);
|
||||
configWarehouseLocationMapper.insert(configWarehouseLocation);
|
||||
// 返回
|
||||
return BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO updateReqVO) {
|
||||
public void updateConfigWarehouseLocation(ConfigWarehouseLocationSaveReqVO reqVo) {
|
||||
// 校验存在
|
||||
validateConfigWarehouseLocationExists(updateReqVO.getId());
|
||||
validateConfigWarehouseLocationExists(reqVo.getId());
|
||||
checkCodeUnique(reqVo);
|
||||
// 更新
|
||||
ConfigWarehouseLocationDO updateObj = BeanUtils.toBean(updateReqVO, ConfigWarehouseLocationDO.class);
|
||||
ConfigWarehouseLocationDO updateObj = BeanUtils.toBean(reqVo, ConfigWarehouseLocationDO.class);
|
||||
configWarehouseLocationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkCodeUnique(ConfigWarehouseLocationSaveReqVO reqVo) {
|
||||
String code = reqVo.getCode();
|
||||
if(ObjectUtils.isEmpty(code)){
|
||||
return;
|
||||
}
|
||||
ConfigWarehouseLocationDO dbData1 = getConfigWarehouseLocation(reqVo.getId());
|
||||
if(!code.equals(dbData1.getCode())){
|
||||
ConfigWarehouseLocationDO dbData = getByCode(code);
|
||||
if(dbData != null){
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkCodeUniqueWithoutId(ConfigWarehouseLocationSaveReqVO reqVo) {
|
||||
String code = reqVo.getCode();
|
||||
if(ObjectUtils.isEmpty(code))
|
||||
return;
|
||||
ConfigWarehouseLocationDO dbData = getByCode(code);
|
||||
if(dbData != null){
|
||||
throw exception(CONFIG_WAREHOUSE_LOCATION_CODE_DUPLICATE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfigWarehouseLocation(Long id) {
|
||||
// 校验存在
|
||||
|
||||
@@ -112,7 +112,7 @@ public class DictionaryBusinessController implements BusinessControllerMarker {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得业务参数字典")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')")
|
||||
public CommonResult<DictionaryBusinessRespVO> getDictionaryBusiness(@RequestParam("id") Long id) {
|
||||
DictionaryBusinessDO dictionaryBusiness = dictionaryBusinessService.getDictionaryBusiness(id);
|
||||
return success(BeanUtils.toBean(dictionaryBusiness, DictionaryBusinessRespVO.class));
|
||||
@@ -120,7 +120,7 @@ public class DictionaryBusinessController implements BusinessControllerMarker {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得业务参数字典分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('qms:dictionary-business:query')")
|
||||
public CommonResult<PageResult<DictionaryBusinessRespVO>> getDictionaryBusinessPage(@Valid DictionaryBusinessPageReqVO pageReqVO) {
|
||||
PageResult<DictionaryBusinessDO> pageResult = dictionaryBusinessService.getDictionaryBusinessPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DictionaryBusinessRespVO.class));
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备-设备信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('resource:device-infomation:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')")
|
||||
public CommonResult<DeviceInfomationRespVO> getDeviceInfomation(@RequestParam("id") Long id) {
|
||||
DeviceInfomationDO deviceInfomation = deviceInfomationService.getDeviceInfomation(id);
|
||||
return success(BeanUtils.toBean(deviceInfomation, DeviceInfomationRespVO.class));
|
||||
@@ -95,7 +95,7 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备-设备信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('resource:device-infomation:query')")
|
||||
// @PreAuthorize("@ss.hasPermission('resource:device-infomation:query')")
|
||||
public CommonResult<PageResult<DeviceInfomationRespVO>> getDeviceInfomationPage(@Valid DeviceInfomationPageReqVO pageReqVO) {
|
||||
Long productId = pageReqVO.getProductId();
|
||||
if(productId != null){
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
-->
|
||||
|
||||
<select id="selectUnAssayTaskGroupList" resultType="com.zt.plat.module.qms.business.bus.controller.vo.BusinessAssayTaskDataGroupRespVO">
|
||||
SELECT
|
||||
SELECT
|
||||
tbatd.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
tcam.NAME AS configAssayMethodName,
|
||||
COUNT(tbatd.ID) AS sampleTaskCount
|
||||
@@ -18,11 +18,15 @@
|
||||
T_BSN_ASY_TSK_DAT tbatd
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tbatd.CFG_ASY_MTHD_ID = tcam.ID
|
||||
LEFT JOIN T_BSN_SB_SMP_ANL_GRP tbssag ON
|
||||
tbatd.BSN_SB_SMP_ID = tbssag.BSN_SB_SMP_ID
|
||||
AND tbatd.ASY_DEPT_ID = tbssag.ASY_DEPT_ID
|
||||
WHERE
|
||||
tbatd.DELETED = 0
|
||||
AND tcam.DELETED = 0
|
||||
AND tbatd.IS_ASN_TSKD = 0
|
||||
AND tbatd.IS_RPOD = 0
|
||||
AND tbssag.SMP_STS = '已收样'
|
||||
<if test="reqVO.assayDepartmentId != null and reqVO.assayDepartmentId != ''">
|
||||
AND tbatd.ASY_DEPT_ID = #{reqVO.assayDepartmentId}
|
||||
</if>
|
||||
@@ -88,6 +92,7 @@
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
t.CFG_ASY_MTHD_ID = tcam.ID
|
||||
AND t.TENANT_ID = tcam.TENANT_ID
|
||||
WHERE t.RPOD_STS in ('pending_report', 'pending_assessment', 're_inspected')
|
||||
GROUP BY
|
||||
t.CFG_ASY_MTHD_ID,
|
||||
t.ASY_TP,
|
||||
|
||||
@@ -11,30 +11,49 @@
|
||||
|
||||
<select id="selectUnReportMethodGroupList" resultType="com.zt.plat.module.qms.business.bus.controller.vo.BusinessSubParentSampleAssessmentGroupRespVO" >
|
||||
SELECT
|
||||
tbspsa.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
tcam.NAME AS configAssayMethodName,
|
||||
tcam.ASY_DEPT_ID AS assayDepartmentId,
|
||||
tcam.ASY_DEPT_NAME AS assayDepartmentName,
|
||||
COUNT(DISTINCT tbspsa.BSN_SB_PRN_SMP_ID) AS sampleCount
|
||||
t.CFG_ASY_MTHD_ID AS configAssayMethodId,
|
||||
t.NAME AS configAssayMethodName,
|
||||
t.ASY_DEPT_ID AS assayDepartmentId,
|
||||
t.ASY_DEPT_NAME AS assayDepartmentName,
|
||||
COUNT(DISTINCT t.BSN_SB_PRN_SMP_ASMT_ID) AS sampleCount
|
||||
FROM
|
||||
T_BSN_SB_PRN_SMP_ASMT tbspsa
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tbspsa.CFG_ASY_MTHD_ID = tcam.ID
|
||||
AND tbspsa.TENANT_ID = tcam.TENANT_ID
|
||||
WHERE
|
||||
tbspsa.DELETED = 0
|
||||
AND tbspsa.IS_RPOD = 0
|
||||
<if test="reqVO.configAssayMethodName != null and reqVO.configAssayMethodName != ''">
|
||||
AND tcam.NAME like '%' || #{reqVO.assayDepartmentId} || '%'
|
||||
</if>
|
||||
<if test="reqVO.assayDepartmentId != null and reqVO.assayDepartmentId != ''">
|
||||
AND tcam.ASY_DEPT_ID = #{reqVO.assayDepartmentId}
|
||||
</if>
|
||||
(
|
||||
SELECT
|
||||
tbspsa.TENANT_ID ,
|
||||
tbssa.BSN_SB_PRN_SMP_ASMT_ID ,
|
||||
tbssa.CFG_ASY_MTHD_ID,
|
||||
tcam.NAME,
|
||||
tcam.ASY_DEPT_ID ,
|
||||
tcam.ASY_DEPT_NAME
|
||||
FROM
|
||||
T_BSN_SB_SMP_ASMT tbssa
|
||||
LEFT JOIN T_BSN_SB_PRN_SMP_ASMT tbspsa ON
|
||||
tbssa.BSN_SB_PRN_SMP_ASMT_ID = tbspsa.ID
|
||||
LEFT JOIN T_CFG_ASY_MTHD tcam ON
|
||||
tbssa.CFG_ASY_MTHD_ID = tcam.ID
|
||||
WHERE
|
||||
tbssa.DELETED = 0
|
||||
AND tbssa.RPOD_STS = 'reported'
|
||||
AND tbspsa.IS_RPOD = 0
|
||||
<if test="reqVO.configAssayMethodName != null and reqVO.configAssayMethodName != ''">
|
||||
AND tcam.NAME like '%' || #{reqVO.assayDepartmentId} || '%'
|
||||
</if>
|
||||
<if test="reqVO.assayDepartmentId != null and reqVO.assayDepartmentId != ''">
|
||||
AND tcam.ASY_DEPT_ID = #{reqVO.assayDepartmentId}
|
||||
</if>
|
||||
GROUP BY
|
||||
tbspsa.TENANT_ID ,
|
||||
tbssa.BSN_SB_PRN_SMP_ASMT_ID ,
|
||||
tbssa.CFG_ASY_MTHD_ID ,
|
||||
tcam.NAME,
|
||||
tcam.ASY_DEPT_ID ,
|
||||
tcam.ASY_DEPT_NAME
|
||||
) t
|
||||
GROUP BY
|
||||
tbspsa.CFG_ASY_MTHD_ID,
|
||||
tcam.NAME,
|
||||
tcam.ASY_DEPT_ID ,
|
||||
tcam.ASY_DEPT_NAME
|
||||
t.CFG_ASY_MTHD_ID,
|
||||
t.NAME,
|
||||
t.ASY_DEPT_ID,
|
||||
t.ASY_DEPT_NAME
|
||||
</select>
|
||||
|
||||
<select id="selectNoReportSubParentSampleAssessment" resultType="com.zt.plat.module.qms.business.bus.controller.vo.NoReportSubParentSampleAssessmentRespVO" >
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleDetailMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.material.dal.mapper.MaterialLifecycleMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.zt.plat.module.qms;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 通用的签名、加解密工具类
|
||||
*/
|
||||
public final class CryptoSignatureUtils {
|
||||
|
||||
public static final String ENCRYPT_TYPE_AES = "AES";
|
||||
public static final String ENCRYPT_TYPE_DES = "DES";
|
||||
public static final String SIGNATURE_TYPE_MD5 = "MD5";
|
||||
public static final String SIGNATURE_TYPE_SHA256 = "SHA256";
|
||||
|
||||
private static final String AES_TRANSFORMATION = "AES/ECB/PKCS5Padding";
|
||||
public static final String SIGNATURE_FIELD = "signature";
|
||||
|
||||
private CryptoSignatureUtils() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成 AES 密钥(SecretKeySpec)
|
||||
*
|
||||
* @param password 密钥字符串
|
||||
* @return SecretKeySpec
|
||||
*/
|
||||
public static SecretKeySpec getSecretKey(String password) {
|
||||
try {
|
||||
KeyGenerator kg = KeyGenerator.getInstance("AES");
|
||||
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
|
||||
random.setSeed(password.getBytes(StandardCharsets.UTF_8));
|
||||
kg.init(128, random);
|
||||
SecretKey secretKey = kg.generateKey();
|
||||
return new SecretKeySpec(secretKey.getEncoded(), "AES");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
throw new IllegalStateException("Failed to generate AES secret key", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对称加密(Base64 格式输出)
|
||||
*
|
||||
* @param plaintext 明文内容
|
||||
* @param key 密钥
|
||||
* @param type 加密类型,支持 AES、DES
|
||||
* @return 密文(Base64 格式)
|
||||
*/
|
||||
public static String encrypt(String plaintext, String key, String type) {
|
||||
if (ENCRYPT_TYPE_AES.equalsIgnoreCase(type)) {
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance(AES_TRANSFORMATION);
|
||||
cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(key));
|
||||
byte[] result = cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8));
|
||||
return Base64.getEncoder().encodeToString(result);
|
||||
} catch (Exception ex) {
|
||||
throw new IllegalStateException("Failed to encrypt using AES", ex);
|
||||
}
|
||||
} else if (ENCRYPT_TYPE_DES.equalsIgnoreCase(type)) {
|
||||
byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] desKey = new byte[8];
|
||||
System.arraycopy(keyBytes, 0, desKey, 0, Math.min(keyBytes.length, desKey.length));
|
||||
byte[] encrypted = SecureUtil.des(desKey).encrypt(plaintext.getBytes(StandardCharsets.UTF_8));
|
||||
return Base64.getEncoder().encodeToString(encrypted);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported encryption type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对称解密(输入为 Base64 格式密文)
|
||||
*
|
||||
* @param ciphertext 密文内容(Base64 格式)
|
||||
* @param key 密钥
|
||||
* @param type 加密类型,支持 AES、DES
|
||||
* @return 明文内容
|
||||
*/
|
||||
public static String decrypt(String ciphertext, String key, String type) {
|
||||
if (ciphertext == null) {
|
||||
return null;
|
||||
}
|
||||
if (ENCRYPT_TYPE_AES.equalsIgnoreCase(type)) {
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance(AES_TRANSFORMATION);
|
||||
cipher.init(Cipher.DECRYPT_MODE, getSecretKey(key));
|
||||
byte[] decoded = decodeBase64Ciphertext(ciphertext);
|
||||
byte[] result = cipher.doFinal(decoded);
|
||||
return new String(result, StandardCharsets.UTF_8);
|
||||
} catch (Exception ex) {
|
||||
throw new IllegalStateException("Failed to decrypt using AES", ex);
|
||||
}
|
||||
} else if (ENCRYPT_TYPE_DES.equalsIgnoreCase(type)) {
|
||||
byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8);
|
||||
byte[] desKey = new byte[8];
|
||||
System.arraycopy(keyBytes, 0, desKey, 0, Math.min(keyBytes.length, desKey.length));
|
||||
byte[] decoded = decodeBase64Ciphertext(ciphertext);
|
||||
byte[] decrypted = SecureUtil.des(desKey).decrypt(decoded);
|
||||
return new String(decrypted, StandardCharsets.UTF_8);
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported encryption type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证请求签名
|
||||
*
|
||||
* @param reqMap 请求参数 Map
|
||||
* @param type 签名算法类型,支持 MD5、SHA256
|
||||
* @return 签名是否有效
|
||||
*/
|
||||
public static boolean verifySignature(Map<String, Object> reqMap, String type) {
|
||||
Map<String, Object> sortedMap = new TreeMap<>(reqMap);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Map.Entry<String, Object> entry : sortedMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
if (SIGNATURE_FIELD.equals(key) || value == null) {
|
||||
continue;
|
||||
}
|
||||
sb.append(key).append('=');
|
||||
sb.append(value);
|
||||
sb.append('&');
|
||||
}
|
||||
if (sb.length() > 0) {
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
String provided = (String) reqMap.get(SIGNATURE_FIELD);
|
||||
if (provided == null) {
|
||||
return false;
|
||||
}
|
||||
String computed;
|
||||
if (SIGNATURE_TYPE_MD5.equalsIgnoreCase(type)) {
|
||||
computed = SecureUtil.md5(sb.toString());
|
||||
} else if (SIGNATURE_TYPE_SHA256.equalsIgnoreCase(type)) {
|
||||
computed = SecureUtil.sha256(sb.toString());
|
||||
} else {
|
||||
throw new IllegalArgumentException("Unsupported signature type: " + type);
|
||||
}
|
||||
return provided.equalsIgnoreCase(computed);
|
||||
}
|
||||
|
||||
private static byte[] decodeBase64Ciphertext(String ciphertext) {
|
||||
IllegalArgumentException last = null;
|
||||
for (String candidate : buildBase64Candidates(ciphertext)) {
|
||||
if (candidate == null || candidate.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
return Base64.getDecoder().decode(candidate);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
last = ex;
|
||||
}
|
||||
}
|
||||
throw last != null ? last : new IllegalArgumentException("Invalid Base64 content");
|
||||
}
|
||||
|
||||
private static Set<String> buildBase64Candidates(String ciphertext) {
|
||||
Set<String> candidates = new LinkedHashSet<>();
|
||||
if (ciphertext == null) {
|
||||
return candidates;
|
||||
}
|
||||
String trimmed = ciphertext.trim();
|
||||
candidates.add(trimmed);
|
||||
|
||||
String withoutWhitespace = stripWhitespace(trimmed);
|
||||
candidates.add(withoutWhitespace);
|
||||
|
||||
if (trimmed.indexOf(' ') >= 0) {
|
||||
String restoredPlus = trimmed.replace(' ', '+');
|
||||
candidates.add(restoredPlus);
|
||||
candidates.add(stripWhitespace(restoredPlus));
|
||||
}
|
||||
|
||||
String urlNormalised = withoutWhitespace
|
||||
.replace('-', '+')
|
||||
.replace('_', '/');
|
||||
candidates.add(urlNormalised);
|
||||
|
||||
return candidates;
|
||||
}
|
||||
|
||||
private static String stripWhitespace(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
boolean hasWhitespace = false;
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
if (Character.isWhitespace(value.charAt(i))) {
|
||||
hasWhitespace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasWhitespace) {
|
||||
return value;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder(value.length());
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char ch = value.charAt(i);
|
||||
if (!Character.isWhitespace(ch)) {
|
||||
sb.append(ch);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,6 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.zt.plat.framework.common.util.security.CryptoSignatureUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.net.URI;
|
||||
@@ -17,9 +13,6 @@ import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.time.Duration;
|
||||
@@ -27,25 +20,17 @@ import java.util.*;
|
||||
|
||||
public class DatabusApiInvocationExample {
|
||||
public static final String TIMESTAMP = Long.toString(System.currentTimeMillis());
|
||||
private static final String APP_ID = "iwork";
|
||||
private static final String APP_SECRET = "lpGXiNe/GMLk0vsbYGLa8eYxXq8tGhTbuu3/D4MJzIk=";
|
||||
// private static final String APP_ID = "test";
|
||||
// private static final String APP_SECRET = "RSYtKXrXPLMy3oeh0cOro6QCioRUgqfnKCkDkNq78sI=";
|
||||
// private static final String APP_ID = "testAnnoy";
|
||||
// private static final String APP_SECRET = "jyGCymUjCFL2i3a4Tm3qBIkUrUl4ZgKPYvOU/47ZWcM=";
|
||||
private static final String APP_ID = "qms-auto-ingredients";
|
||||
private static final String APP_SECRET = "tjDKCUGNEDR9yNgbxIsvtXsRMuQK+tj1HNEMpgjJOPU=";
|
||||
private static final String ENCRYPTION_TYPE = CryptoSignatureUtils.ENCRYPT_TYPE_AES;
|
||||
// private static final String TARGET_API = "http://172.16.46.63:30081/admin-api/databus/api/portal/";
|
||||
private static final String TARGET_API = "http://127.0.0.1:48080/admin-api/databus/api/portal/";
|
||||
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder()
|
||||
.connectTimeout(Duration.ofSeconds(5))
|
||||
.build();
|
||||
private static final String TARGET_API = "http://172.16.46.62:30081/admin-api/databus/api/portal";
|
||||
private static final HttpClient HTTP_CLIENT = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(5)).build();
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
private static final PrintStream OUT = buildConsolePrintStream();
|
||||
public static final String ZT_APP_ID = "ZT-App-Id";
|
||||
public static final String ZT_TIMESTAMP = "ZT-Timestamp";
|
||||
public static final String ZT_NONCE = "ZT-Nonce";
|
||||
public static final String ZT_SIGNATURE = "ZT-Signature";
|
||||
public static final String ZT_AUTH_TOKEN = "ZT-Auth-Token";
|
||||
public static final String CONTENT_TYPE = "Content-Type";
|
||||
|
||||
private DatabusApiInvocationExample() {
|
||||
@@ -61,13 +46,14 @@ public class DatabusApiInvocationExample {
|
||||
|
||||
private static void executeGetExample() throws Exception {
|
||||
Map<String, Object> queryParams = new LinkedHashMap<>();
|
||||
queryParams.put("businessCode", "11");
|
||||
queryParams.put("fileId", "11");
|
||||
queryParams.put("null", null);
|
||||
queryParams.put("taskTimeStart", "2025-11-27 09:00:00");
|
||||
queryParams.put("taskTimeEnd", "2025-11-28 23:00:00");
|
||||
// queryParams.put("id", "1994323064365080578");
|
||||
String signature = generateSignature(queryParams, Map.of());
|
||||
URI requestUri = buildUri(TARGET_API, queryParams);
|
||||
String nonce = "171615676c7d4d96b9f55f3d90ad27e0";
|
||||
|
||||
String url = TARGET_API + "/qms.ytjc.auto-ingredients.task-list/v1"; //获取检验批列表
|
||||
// String url = TARGET_API + "/qms.ytjc.auto-ingredients.task-detail-list/v1"; //获取检验批中的检测任务
|
||||
URI requestUri = buildUri(url, queryParams);
|
||||
String nonce = randomNonce();
|
||||
HttpRequest request = HttpRequest.newBuilder(requestUri)
|
||||
.timeout(Duration.ofSeconds(10))
|
||||
.header(ZT_APP_ID, APP_ID)
|
||||
@@ -77,26 +63,57 @@ public class DatabusApiInvocationExample {
|
||||
// .header("ZT-Auth-Token", "a75c0ea94c7f4a88b86b60bbc0b432c3")
|
||||
.GET()
|
||||
.build();
|
||||
|
||||
HttpResponse<String> response = HTTP_CLIENT.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
|
||||
printResponse(response);
|
||||
}
|
||||
|
||||
private static void executePostExample() throws Exception {
|
||||
Map<String, Object> queryParams = new LinkedHashMap<>();
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
jsonObject.put("id", "1983446576685985794");
|
||||
jsonObject.put("remark", "");
|
||||
|
||||
// long extraTimestamp = 1761556157185L;
|
||||
// String bodyJson = String.format(jsonObject.toJSONString(), extraTimestamp);
|
||||
String jsonStr = "{\n" +
|
||||
" \"taskId\": \"1994323064365080578\",\n" +
|
||||
" \"sampleList\": [\n" +
|
||||
" {\n" +
|
||||
" \"id\": \"1994322711672328211\",\n" +
|
||||
" \"sampleCode\": \"TJK2511-0004\",\n" +
|
||||
" \"sampleName\": \"铜精矿\",\n" +
|
||||
" \"cupNumber\": \"2\",\n" +
|
||||
" \"ingredient_AgNO3\": \"0\",\n" +
|
||||
" \"ingredient_C\": \"7.4\",\n" +
|
||||
" \"ingredient_KNO3\": \"0\",\n" +
|
||||
" \"ingredient_Na2B4O7_10H2O\": \"12.3\",\n" +
|
||||
" \"ingredient_Na2CO3\": \"19.3\",\n" +
|
||||
" \"ingredient_PbO\": \"170.1\",\n" +
|
||||
" \"ingredient_SiO2\": \"18.4\",\n" +
|
||||
" \"remark\": [\n" +
|
||||
" \"备注1==\",\n" +
|
||||
" \"备注2==\"\n" +
|
||||
" ]\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"id\": \"1994322711672328196\",\n" +
|
||||
" \"sampleCode\": \"TJK2511-0004\",\n" +
|
||||
" \"sampleName\": \"铜精矿\",\n" +
|
||||
" \"cupNumber\": \"1\",\n" +
|
||||
" \"ingredient_AgNO3\": \"0\",\n" +
|
||||
" \"ingredient_C\": \"7.5\",\n" +
|
||||
" \"ingredient_KNO3\": \"0\",\n" +
|
||||
" \"ingredient_Na2B4O7_10H2O\": \"12\",\n" +
|
||||
" \"ingredient_Na2CO3\": \"19.2\",\n" +
|
||||
" \"ingredient_PbO\": \"170.4\",\n" +
|
||||
" \"ingredient_SiO2\": \"17.9\",\n" +
|
||||
" \"remark\": [\n" +
|
||||
" \"备注1\",\n" +
|
||||
" \"备注2\"\n" +
|
||||
" ]\n" +
|
||||
" }\n" +
|
||||
" ]\n" +
|
||||
"}";
|
||||
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
||||
String bodyJson = jsonObject.toJSONString();
|
||||
|
||||
Map<String, Object> bodyParams = parseBodyJson(bodyJson);
|
||||
String signature = generateSignature(queryParams, bodyParams);
|
||||
String url = TARGET_API + "qms.ytjc.iwork/v1";
|
||||
String url = TARGET_API + "/qms.ytjc.auto-ingredients.submit-assay-result/v1";
|
||||
URI requestUri = buildUri(url, queryParams);
|
||||
String nonce = randomNonce();
|
||||
String cipherBody = encryptPayload(bodyJson);
|
||||
@@ -109,7 +126,6 @@ public class DatabusApiInvocationExample {
|
||||
.header(ZT_TIMESTAMP, TIMESTAMP)
|
||||
.header(ZT_NONCE, nonce)
|
||||
.header(ZT_SIGNATURE, signature)
|
||||
.header(ZT_AUTH_TOKEN, "82e5c281ddfa4386988fa4074e8794d7")
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.POST(HttpRequest.BodyPublishers.ofString(cipherBody, StandardCharsets.UTF_8))
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user