zhuo
2025-05-06 25e115da7815430fdc5d078d4a01d76edacb4e6f
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -654,7 +654,7 @@
            ifsInventoryQuantity.setIsSource(1);
            ifsInventoryQuantity.setState(0);
            IfsInventoryQuantity one = ifsInventoryQuantityMapper.selectOne(new LambdaQueryWrapper<IfsInventoryQuantity>()
            Long count = ifsInventoryQuantityMapper.selectCount(new LambdaQueryWrapper<IfsInventoryQuantity>()
                    .eq(IfsInventoryQuantity::getOrderNo, ifsInventoryQuantity.getOrderNo())
                    .eq(IfsInventoryQuantity::getLineNo, ifsInventoryQuantity.getLineNo())
                    .eq(IfsInventoryQuantity::getReleaseNo, ifsInventoryQuantity.getReleaseNo())
@@ -666,8 +666,7 @@
                    .eq(IfsInventoryQuantity::getWaivDevRejNo, ifsInventoryQuantity.getWaivDevRejNo())
                    .eq(IfsInventoryQuantity::getActivitySeq, ifsInventoryQuantity.getActivitySeq())
            );
            if(Objects.isNull(one)) {
            if(count == 0) {
                ifsInventoryQuantity.setIsFirst(0);
                // 查询产业链检测数据
                String industryChainAttrFields = IndustryChainUtils.getIndustryChainAttrFields(ifsInventoryQuantity.getOrderNo(),
@@ -907,6 +906,10 @@
        // 修改检验项
        for (SampleProductDto sampleProductDto : insOrderUpdateDto.getSampleProduct()) {
            insSampleService.update(Wrappers.<InsSample>lambdaUpdate()
                    .eq(InsSample::getId, sampleProductDto.getId())
                    .set(InsSample::getSpecialStandardMethod, sampleProductDto.getSpecialStandardMethod()));
            insProductService.updateBatchById(sampleProductDto.getInsProduct());
        }
@@ -968,6 +971,7 @@
                product.setCreateUser(null);
                product.setUpdateTime(null);
                product.setUpdateUser(null);
                product.setSection(null);
                product.setInsSampleId(omitOrderProductDto.getInsSampleId());
                if (StringUtils.isBlank(product.getCableTag())) {
                    product.setCableTag(null);
@@ -992,16 +996,21 @@
     */
    @Override
    public void rawAllInsOrderExport(SampleOrderDto sampleOrderDto, HttpServletResponse response) {
        //判断全部,个人,组织的权限
        //todo:仅看我获取当前人所属实验室id
        String laboratory = null;
        // 判断是否是全部
        String isOrderAll = null;
        if (sampleOrderDto.getState() != null && sampleOrderDto.getState() == -2) {
            isOrderAll = "1";
            sampleOrderDto.setState(null);
        List<SampleOrderDto> sampleOrderDtoList = new ArrayList<>();
        if (StringUtils.isNotBlank(sampleOrderDto.getIds())) {
            List<String> orderIds = StrUtil.split(sampleOrderDto.getIds(), ",");
            sampleOrderDtoList = insOrderMapper.getInsOrderExportByIds(orderIds);
        } else {
            String laboratory = null;
            // 判断是否是全部
            String isOrderAll = null;
            if (sampleOrderDto.getState() != null && sampleOrderDto.getState() == -2) {
                isOrderAll = "1";
                sampleOrderDto.setState(null);
            }
            sampleOrderDto.setIds(null);
            sampleOrderDtoList = insOrderMapper.rawAllInsOrderExport(QueryWrappers.queryWrappers(sampleOrderDto), laboratory, isOrderAll);
        }
        List<SampleOrderDto> sampleOrderDtoList = insOrderMapper.rawAllInsOrderExport(QueryWrappers.queryWrappers(sampleOrderDto), laboratory, isOrderAll);
        // 判断是否是不合格, 不合格查询不合格项
        for (SampleOrderDto orderDto : sampleOrderDtoList) {
@@ -1034,6 +1043,24 @@
        }
    }
    /**
     * 修改样品型号
     * @param insSample
     */
    @Override
    public void updateSampleModel(InsSample insSample) {
        // 判断当前订单是否生成了报告, 生成了报告不能修改单号
        Long count = insReportMapper.selectCount(Wrappers.<InsReport>lambdaQuery()
                .eq(InsReport::getInsOrderId, insSample.getInsOrderId()));
        if (count > 0 ) {
            throw new ErrorException("当前订单已经生成了报告不能修改编号");
        }
        insSampleService.update(Wrappers.<InsSample>lambdaUpdate()
                .eq(InsSample::getId, insSample.getId())
                .set(InsSample::getModel, insSample.getModel()));
    }
}