zouyu
2025-09-29 12c5c9b4eaaac1dc51cd0be88864260535394541
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/RawMaterialOrderServiceImpl.java
@@ -42,9 +42,11 @@
import com.ruoyi.inspect.mapper.InsOrderMapper;
import com.ruoyi.inspect.mapper.InsProductMapper;
import com.ruoyi.inspect.mapper.InsSampleMapper;
import com.ruoyi.inspect.mapper.InsUnqualifiedHandlerMapper;
import com.ruoyi.inspect.pojo.IfsSplitOrderRecord;
import com.ruoyi.inspect.pojo.InsOrder;
import com.ruoyi.inspect.pojo.InsReport;
import com.ruoyi.inspect.pojo.InsUnqualifiedHandler;
import com.ruoyi.inspect.service.IfsSplitOrderRecordService;
import com.ruoyi.inspect.service.InsOrderService;
import com.ruoyi.inspect.service.InsReportService;
@@ -100,6 +102,8 @@
    private IfsApiUtils ifsApiUtils;
    private IfsSplitOrderRecordService ifsSplitOrderRecordService;
    private InsUnqualifiedHandlerMapper insUnqualifiedHandlerMapper;
    @Override
@@ -172,31 +176,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;
    }
@@ -597,16 +601,13 @@
        if (!ifsInventoryQuantity.getInspectStatus().equals(2)) {
            throw new ErrorException("不合格的原材料才能让步放行");
        }
        // todo:需要判断oa流程是否是让步放行
        String toLocation = insOrderService.moveRawMaterial(ifsInventoryQuantity);
        ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>()
        return ifsInventoryQuantityMapper.update(null, new LambdaUpdateWrapper<IfsInventoryQuantity>()
                .set(IfsInventoryQuantity::getInspectStatus, 4)
                .set(IfsInventoryQuantity::getToLocation, toLocation)
                .eq(IfsInventoryQuantity::getId, ifsInventoryId));
        return true;
                .eq(IfsInventoryQuantity::getId, ifsInventoryId))>0;
    }
    /**