zhuo
2025-02-28 b9ff0ede78518a3c7c160f12942acd9410c33ce5
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -119,8 +119,6 @@
    @Resource
    private InsProductUserMapper insProductUserMapper;
    @Resource
    private InsUnPassService insUnPassService;
    @Resource
    private AuxiliaryOutputWorkingHoursService auxiliaryOutputWorkingHoursService;
    @Resource
    private AuxiliaryOutputWorkingHoursTemporaryService auxiliaryOutputWorkingHoursTemporaryService;
@@ -132,7 +130,6 @@
    private CustomMapper customMapper;
    @Value("${file.path}")
    private String imgUrl;
    @Resource
    private InsOrderFileMapper insOrderFileMapper;
    @Resource
@@ -1116,7 +1113,6 @@
     * @param orderId
     */
    private void generateReport(Integer orderId) {
        List<InsUnPass> insUnPasses = new ArrayList<>();
        /*样品下的项目只要有一个项目不合格则检验结果为0,否则为1*/
        //这里的insSamples是订单下的所有样品包括("/")
        List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId));
@@ -1132,25 +1128,7 @@
                insSample.setInsResult(1);
            }
            insSampleMapper.updateById(insSample);
            /*复核通过后,将不合格的项目信息添加到ins_un_pass表中*/
            for (InsProduct insProduct : insProducts) {
                if (insProduct.getInsResult() == 0) {
                    InsUnPass insUnPass = new InsUnPass();
                    insUnPass.setId(null);
                    insUnPass.setModel(insSample.getModel());
                    insUnPass.setSample(insSample.getSample());
                    insUnPass.setInspectionItem(insProduct.getInspectionItem());
                    insUnPass.setInspectionItemSubclass(insProduct.getInspectionItemSubclass());
                    insUnPass.setLastValue(insProduct.getLastValue());
                    insUnPass.setEntrustCode(insOrderMapper.selectById(orderId).getEntrustCode());
                    List<Integer> userIds = insProductUserMapper.selectList(Wrappers.<InsProductUser>lambdaQuery().eq(InsProductUser::getInsProductId, insProduct.getId())).stream().map(InsProductUser::getCreateUser).distinct().collect(Collectors.toList());
                    String name = userMapper.selectBatchIds(userIds).stream().map(User::getName).collect(Collectors.joining(","));
                    insUnPass.setName(name);
                    insUnPasses.add(insUnPass);
                }
            }
        }
        insUnPassService.saveBatch(insUnPasses);
        InsOrder insOrder = insOrderMapper.selectById(orderId);
        // 抽检变成委托检验
        if (insOrder.getOrderType().equals(InsOrderTypeConstants.SPOT_CHECK)) {