zhuo
2025-04-22 d55fe4255a7fa2b1a9c7a8f5d00a0b7683649e2d
预警功能调整
已修改2个文件
21 ■■■■ 文件已修改
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/web/ssoAuth/SsoCodeAuthenticationProvider.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -822,9 +822,10 @@
        // 5.发送消息通知给复核人
        // 查询当前人信息
        Integer userId = SecurityUtils.getUserId().intValue();
        String userName = insProductMapper.selectUserById(userId).get("name");
        Map<String, String> userMap = insProductMapper.selectUserById(verifyUser);
        String userName = userMap.get("name");
        // 查询发送人信息
        String sendUserAccount = insProductMapper.selectUserById(verifyUser).get("account");
        String sendUserAccount = userMap.get("account");
        InformationNotification info = new InformationNotification();
        info.setCreateUser(userName);
        info.setMessageType("2");
@@ -938,7 +939,7 @@
            // 查询ifs信息获取获取前10个供应商一样的, 检验项一样信息
            threadPoolTaskExecutor.execute(() -> {
                // 添加分析数据
                addAnalysis(productList, ifsInventoryQuantity, order, userName);
                addAnalysis(productList, ifsInventoryQuantity, order, sendUserAccount);
            });
@@ -966,13 +967,13 @@
     * @param ifsInventoryQuantity
     * @param order
     */
    private void addAnalysis(List<InsProduct> productList, IfsInventoryQuantity ifsInventoryQuantity, InsOrder order, String userName) {
    private void addAnalysis(List<InsProduct> productList, IfsInventoryQuantity ifsInventoryQuantity, InsOrder order, String sendUserAccount) {
        for (InsProduct insProduct : productList) {
            // 判断是否是数值类型
            if (insProduct.getInspectionValueType().equals("1") && insProduct.getInsResult().equals(1)) {
                List<InsProductDeviationWarningDetail> insProductAnalysisDtoList = insProductMapper.selectAnalysis(insProduct, ifsInventoryQuantity.getSupplierName());
                if (insProductAnalysisDtoList.size() < 5) {
                if (insProductAnalysisDtoList.size() < 10) {
                    continue;
                }
@@ -1033,10 +1034,10 @@
                            message += "\n检验项: " + insProduct.getInspectionItem() + insProduct.getInspectionItemSubclass();
                            message += "\n偏差超过了 10%";
                            // 发送给提交人
                            WxCpUtils.inform(userName, message, null);
                            // todo: 发送给检测中心主任(固定死)
                            WxCpUtils.inform("ZT-004704", message, null);
//                            WxCpUtils.inform(sendUserAccount, message, null);
//
//                            // todo: 发送给检测中心主任(固定死)
//                            WxCpUtils.inform("ZT-004704", message, null);
                        } catch (Exception e) {
                            e.printStackTrace();
                            log.error("偏差预警企业微信通知报错");
ruoyi-framework/src/main/java/com/ruoyi/framework/web/ssoAuth/SsoCodeAuthenticationProvider.java
@@ -28,7 +28,7 @@
    @Override
    public boolean supports(Class<?> authentication) {
        // 判断 authentication 是不是 WxCodeAuthenticationToken 的子类或子接口
        // 判断 authentication 是不是 SsoCodeAuthenticationToken 的子类或子接口
        return SsoCodeAuthenticationToken.class.isAssignableFrom(authentication);
    }