zhuo
2025-04-15 79307172cb39dad68ce93106eb986fec2fc8fb60
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderServiceImpl.java
@@ -501,7 +501,7 @@
            }
            // 生成编号
            String no = numberGenerator.generateNumberWithPrefix(3,
                    "JCZX/ZB-" + code + LimsDateUtil.resetDate(LocalDateTime.now()),
                    "JCZX/NS-" + code + LimsDateUtil.resetDate(LocalDateTime.now()),
                    InsOrder::getEntrustCode);
            // 判断是否是季度检验, 是季度检验取消原材料季度检验下单
            if (InsOrderTypeConstants.QUARTERLY_TEST.equals(order.getOrderType())) {
@@ -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(),
@@ -968,6 +967,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);
@@ -1034,6 +1034,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()));
    }
}