zss
6 天以前 23d35c163bd5308fc4a8e94cda87881d9547a251
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -75,7 +75,7 @@
    private InsSampleMapper insSampleMapper;
    private final NumberGenerator<InsOrder> numberGenerator;
    private InsReportService insReportService;
    private WechatProperty wechatProperty;
//    private WechatProperty wechatProperty;
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    private InsProductMapper insProductMapper;
    private AuxiliaryOutputWorkingHoursMapper auxiliaryOutputWorkingHoursMapper;
@@ -151,31 +151,31 @@
                .set(IfsInventoryQuantity::getIsInspect, 1)
                .set(IfsInventoryQuantity::getDeclareDate, LocalDateTime.now())
        );
        threadPoolTaskExecutor.execute(() -> {
            List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery()
                    .in(IfsInventoryQuantity::getId, ids));
            // 企业微信通知
            String message = "";
            message += "新增报检通知";
            for (IfsInventoryQuantity inventoryQuantity : quantityList) {
                message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo();
                message += "\n零件描述: " + inventoryQuantity.getPartDesc();
                message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
                // 判断有没有到20吨. 或者能否免检
                int result = notificationRawOrder(inventoryQuantity.getId());
                switch (result) {
                    case 1:
                        message += "\n当前样品已检验过, 可以免检";
                        break;
                    case 2:
                        message += "\n当前样品已超过20吨";
                        break;
                }
                message += "\n";
            }
            WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
        });
//        threadPoolTaskExecutor.execute(() -> {
//            List<IfsInventoryQuantity> quantityList = ifsInventoryQuantityMapper.selectList(Wrappers.<IfsInventoryQuantity>lambdaQuery()
//                    .in(IfsInventoryQuantity::getId, ids));
//            // 企业微信通知
//            String message = "";
//            message += "新增报检通知";
//            for (IfsInventoryQuantity inventoryQuantity : quantityList) {
//                message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo();
//                message += "\n零件描述: " + inventoryQuantity.getPartDesc();
//                message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
//
//                // 判断有没有到20吨. 或者能否免检
//                int result = notificationRawOrder(inventoryQuantity.getId());
//                switch (result) {
//                    case 1:
//                        message += "\n当前样品已检验过, 可以免检";
//                        break;
//                    case 2:
//                        message += "\n当前样品已超过20吨";
//                        break;
//                }
//                message += "\n";
//            }
//            WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
//        });
        return 1;
    }
@@ -219,16 +219,16 @@
                .set(IfsInventoryQuantity::getUpdateBatchNo, ifsInventoryQuantity.getUpdateBatchNo())
        );
        threadPoolTaskExecutor.execute(() -> {
            IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId());
            // 企业微信通知
            String message = "";
            message += "新增报检通知";
            message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo();
            message += "\n零件描述: " + inventoryQuantity.getPartDesc();
            message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
            WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
        });
//        threadPoolTaskExecutor.execute(() -> {
//            IfsInventoryQuantity inventoryQuantity = ifsInventoryQuantityMapper.selectById(ifsInventoryQuantity.getId());
//            // 企业微信通知
//            String message = "";
//            message += "新增报检通知";
//            message += "\n批次号: " + inventoryQuantity.getUpdateBatchNo();
//            message += "\n零件描述: " + inventoryQuantity.getPartDesc();
//            message += "\n抵达数量: " + inventoryQuantity.getQtyArrived().stripTrailingZeros().toPlainString() + inventoryQuantity.getBuyUnitMeas();
//            WxCpUtils.informWebHook(wechatProperty.getExaminingUrl(), message);
//        });
        return 1;
    }