wlzboy
2025-10-26 5c5cddb1c2ee0d19adddebaf3a3a10a6d93fd2ad
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/VehicleSyncServiceImpl.java
@@ -231,12 +231,12 @@
    }
    /**
     * 从CarOrdClass解析部门ID
     * 从 CarOrdClass 解析部门ID,并转换为分公司ID
     * CarOrdClass格式可能是:ZB、HB.TI等
     * 需要拆分并在sys_dept中匹配dispatch_order_class字段
     * 
     * @param carOrdClass 车辆单据类型编码
     * @return 部门ID,如果未找到返回null
     * @return 分公司ID,如果未找到返回null
     */
    private Long parseDeptIdFromCarOrdClass(String carOrdClass)
    {
@@ -264,7 +264,19 @@
            {
                log.debug("通过dispatch_order_class='{}' 找到部门: {} (ID={})", 
                        code, dept.getDeptName(), dept.getDeptId());
                return dept.getDeptId();
                // 将部门ID转换为分公司ID
                Long branchCompanyId = sysDeptMapper.selectBranchCompanyIdByDeptId(dept.getDeptId());
                if (branchCompanyId != null)
                {
                    log.debug("将部门ID {} 转换为分公司ID: {}", dept.getDeptId(), branchCompanyId);
                    return branchCompanyId;
                }
                else
                {
                    log.warn("部门ID {} 无法转换为分公司ID,可能是总公司或数据异常", dept.getDeptId());
                    return null;
                }
            }
        }